/******************************************************************************
 Copyright (c) 2024-2025 Qualcomm Technologies International, Ltd.
 All Rights Reserved.
 Qualcomm Technologies International, Ltd. Confidential and Proprietary.

******************************************************************************/

#include "csr_bt_usr_config.h"
#include "csr_bt_config.h"

#ifdef INSTALL_CHANNEL_SOUNDING_SUPPORT

#include "csr_synergy.h"
#include "cm_cs.h"
#include "csr_bt_cm_util.h"
#include "csr_bt_cm_dm.h"
#include "csr_bt_cm_private_prim.h"

#ifdef CSR_STREAMS_ENABLE
extern Source vm_trap_StreamChannelSoundingSource(void);
extern void CmStreamFlushSource(Source src);
#endif /* CSR_STREAMS_ENABLE */

static void cmCsLeSetSearchParameters(CmCsCommonParams* para, CsrBtCmPrim primType)
{
    para->primType      = primType;
    para->addrt.type    = CSR_BT_ADDR_INVALID;
    para->configId      = CS_INVALID_CONFIG_ID;
    SetBdAddrInvalid(&para->addrt.addr);
}

static void cmCsAddPendingMsg(cmInstanceData_t *cmData, CsrBtCmPrim primType)
{
    cmPendingMsg_t *pendingMsg;

    CsrPCmnListAddLast(cmData->pendingMsgs, sizeof(*pendingMsg), pendingMsg);
    pendingMsg->type = CM_PENDING_MSG_CS;
    pendingMsg->arg.csParams.primType = primType;
    pendingMsg->arg.csParams.addrt.type = CSR_BT_ADDR_INVALID;
    SetBdAddrInvalid(&pendingMsg->arg.csParams.addrt.addr);
    pendingMsg->arg.csParams.configId = CS_INVALID_CONFIG_ID;

    switch (primType)
    {
        case CM_LE_CS_INIT_REQ:
        {
            CmLeCsInitReq* req = (CmLeCsInitReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            break;
        }

        case CM_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ:
        {
            CmLeCsReadLocalSupportedCapabilitiesReq* req = (CmLeCsReadLocalSupportedCapabilitiesReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            break;
        }

        case CM_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ:
        {
            CmLeCsReadRemoteSupportedCapabilitiesReq* req = (CmLeCsReadRemoteSupportedCapabilitiesReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ:
        {
            CmLeCsWriteCachedRemoteSupportedCapabilitiesReq* req = (CmLeCsWriteCachedRemoteSupportedCapabilitiesReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_SECURITY_ENABLE_REQ:
        {
            CmLeCsSecurityEnableReq* req = (CmLeCsSecurityEnableReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_DEFAULT_SETTINGS_REQ:
        {
            CmLeCsDefaultSettingsReq* req = (CmLeCsDefaultSettingsReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_READ_REMOTE_FAE_TABLE_REQ:
        {
            CmLeCsReadRemoteFaeTableReq* req = (CmLeCsReadRemoteFaeTableReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ:
        {
            CmLeCsWriteCachedRemoteFaeTableReq* req = (CmLeCsWriteCachedRemoteFaeTableReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_CREATE_CONFIG_REQ:
        {
            CmLeCsCreateConfigReq* req = (CmLeCsCreateConfigReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            pendingMsg->arg.csParams.configId = req->configId;
            break;
        }

        case CM_LE_CS_REMOVE_CONFIG_REQ:
        {
            CmLeCsRemoveConfigReq* req = (CmLeCsRemoveConfigReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            pendingMsg->arg.csParams.configId = req->configId;
            break;
        }

        case CM_LE_CS_SET_CHANNEL_CLASSIFICATION_REQ:
        {
            CmLeCsSetChannelClassificationReq* req = (CmLeCsSetChannelClassificationReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            break;
        }

        case CM_LE_CS_SET_PROCEDURE_PARAMETERS_REQ:
        {
            CmLeCsSetProcedureParametersReq* req = (CmLeCsSetProcedureParametersReq*) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            break;
        }

        case CM_LE_CS_PROCEDURE_ENABLE_REQ:
        {
            CmLeCsProcedureEnableReq *req = (CmLeCsProcedureEnableReq *) cmData->recvMsgP;
            pendingMsg->arg.csParams.appHandle = req->appHandle;
            pendingMsg->arg.csParams.addrt = req->addrt;
            pendingMsg->arg.csParams.configId = req->configId;
            break;
        }

        default:
        {
            CSR_LOG_TEXT_DEBUG((CsrBtCmLto, 0, "cmCsAddPendingMsg MESSAGE:primType:0x%x",primType));
            break;
        }
    }
}

static CsrBool cmCsGetPendingMsgCompare(CsrCmnListElm_t *elem, void *data)
{
    cmPendingMsg_t *pendingMsg = (cmPendingMsg_t*) elem;
    CmCsCommonParams *params = (CmCsCommonParams*) data;

    if(pendingMsg->type == CM_PENDING_MSG_CS)
    {
        if(params->addrt.type == CSR_BT_ADDR_INVALID)
        {
            return (pendingMsg->arg.csParams.primType == params->primType);
        }
        else
        {
            return (pendingMsg->arg.csParams.primType == params->primType && 
                    pendingMsg->arg.csParams.addrt.type == params->addrt.type &&
                    CsrBtBdAddrEq(&pendingMsg->arg.csParams.addrt.addr, &params->addrt.addr) &&
                    pendingMsg->arg.csParams.configId == params->configId);
        }
    }

    return FALSE;
}

static cmPendingMsg_t * cmCsGetPendingMsg(cmInstanceData_t *cmData, CmCsCommonParams *params)
{
    cmPendingMsg_t *pendingMsg = NULL;

    if (cmData->pendingMsgs)
    {
        pendingMsg = (cmPendingMsg_t *) CsrCmnListSearch((CsrCmnList_t *) cmData->pendingMsgs,
                                                         cmCsGetPendingMsgCompare,
                                                         params);
    }
    return pendingMsg;
}

void CmCsLeInitReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsInitReq *req = (CmLeCsInitReq *) cmData->recvMsgP;
    DM_ULP_CS_INIT_REQ_T *dmPrim = zpnew(DM_ULP_CS_INIT_REQ_T);

    dmPrim->type = DM_ULP_CS_INIT_REQ;
    dmPrim->security_level = req->securityLevel;
    dmPrim->roles_supported = req->rolesSupported;
    dmPrim->flags = req->flags;
    dmPrim->context = req->context;

    cmCsAddPendingMsg(cmData, CM_LE_CS_INIT_REQ);

    DM_PutMsg(dmPrim);
}

void CmCsLeInitCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_INIT_CFM_T *dmCfm = (DM_ULP_CS_INIT_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;
    cmCsLeSetSearchParameters(&params, CM_LE_CS_INIT_REQ);

    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if(pendingMsg)
    {
        CmLeCsInitCfm *cfm = (CmLeCsInitCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_INIT_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);

        if (dmCfm->status == HCI_SUCCESS)
        {
            cfm->context = dmCfm->context;
            cfm->flags   = dmCfm->flags;
            cfm->rolesSupported = dmCfm->roles_supported;
        }

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeReadLocalSupportedCapabilitiesReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsReadLocalSupportedCapabilitiesReq *req = (CmLeCsReadLocalSupportedCapabilitiesReq *) cmData->recvMsgP;
    DM_HCI_ULP_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ_T *dmPrim = zpnew(DM_HCI_ULP_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ_T);

    CSR_UNUSED(req);

    dmPrim->common.op_code = DM_HCI_ULP_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ;
    cmCsAddPendingMsg(cmData, CM_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ);

    DM_PutMsg(dmPrim);
}

void CmCsLeReadLocalSupportedCapabilitiesCfmHandler(cmInstanceData_t *cmData)
{
    DM_HCI_ULP_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_CFM_T *dmCfm = (DM_HCI_ULP_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_REQ);
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsReadLocalSupportedCapabilitiesCfm *cfm = (CmLeCsReadLocalSupportedCapabilitiesCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_READ_LOCAL_SUPPORTED_CAPABILITIES_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);

        if (dmCfm->status == HCI_SUCCESS)
        {
            CsrMemCpy(&cfm->cap, &dmCfm->dm_cs_capabilities, sizeof(cfm->cap));
        }

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeReadRemoteSupportedCapabilitiesReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsReadRemoteSupportedCapabilitiesReq *req = (CmLeCsReadRemoteSupportedCapabilitiesReq *) cmData->recvMsgP;
    DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ_T *dmPrim = zpnew(DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ);

    dmPrim->type  = DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ;
    dmPrim->addrt = req->addrt;

    DM_PutMsg(dmPrim);
}

void CmCsLeReadRemoteSupportedCapabilitiesCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_CFM_T *dmCfm = (DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_REQ);
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsReadRemoteSupportedCapabilitiesCfm *cfm = (CmLeCsReadRemoteSupportedCapabilitiesCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);

        if (dmCfm->status == HCI_SUCCESS)
        {
            cfm->addrt  = dmCfm->addrt;
            CsrMemCpy(&cfm->cap, &dmCfm->dm_cs_capabilities, sizeof(cfm->cap));
        }

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeReadRemoteSupportedCapabilitiesIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_IND_T *dmInd = 
    (DM_ULP_CS_READ_REMOTE_SUPPORTED_CAPABILITIES_IND_T *) cmData->recvMsgP;

    CsrBtCmPropgateEvent(cmData,
                         CmPropogateCsReadRemoteSupportedCapIndHandler,
                         CM_EVENT_MASK_SUBSCRIBE_CHANNEL_SOUNDING_IND,
                         dmInd->status,
                         NULL,
                         NULL);
}

void CmCsLeWriteCachedRemoteSupportedCapabilitiesReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsWriteCachedRemoteSupportedCapabilitiesReq *req = (CmLeCsWriteCachedRemoteSupportedCapabilitiesReq *) cmData->recvMsgP;
    DM_ULP_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ_T *dmPrim = zpnew(DM_ULP_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ);

    dmPrim->type  = DM_ULP_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ;
    dmPrim->addrt = req->addrt;

    CsrMemCpy(&dmPrim->dm_cs_capabilities, &req->cap, sizeof(dmPrim->dm_cs_capabilities));

    DM_PutMsg(dmPrim);
}

void CmCsLeWriteCachedRemoteSupportedCapabilitiesCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_CFM_T *dmCfm = (DM_ULP_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_REQ);
    SynMemCpyS(&params.addrt, sizeof(CsrBtTypedAddr), &dmCfm->addrt, sizeof(CsrBtTypedAddr));
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsWriteCachedRemoteSupportedCapabilitiesCfm *cfm = (CmLeCsWriteCachedRemoteSupportedCapabilitiesCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPABILITIES_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeSecurityEnableReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsSecurityEnableReq *req = (CmLeCsSecurityEnableReq *) cmData->recvMsgP;
    DM_ULP_CS_SECURITY_ENABLE_REQ_T *dmPrim = zpnew(DM_ULP_CS_SECURITY_ENABLE_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_SECURITY_ENABLE_REQ);

    dmPrim->type = DM_ULP_CS_SECURITY_ENABLE_REQ;
    dmPrim->addrt = req->addrt;

    DM_PutMsg(dmPrim);
}

void CmCsLeSecurityEnableCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_SECURITY_ENABLE_CFM_T *dmCfm = (DM_ULP_CS_SECURITY_ENABLE_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_SECURITY_ENABLE_REQ);
    params.addrt= dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsSecurityEnableCfm *cfm = (CmLeCsSecurityEnableCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_SECURITY_ENABLE_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeSecurityEnableIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_SECURITY_ENABLE_IND_T *dmInd = (DM_ULP_CS_SECURITY_ENABLE_IND_T *) cmData->recvMsgP;

    CsrBtCmPropgateEvent(cmData,
                         CmPropogateCsLeSecurityEnableInd,
                         CM_EVENT_MASK_SUBSCRIBE_CHANNEL_SOUNDING_IND,
                         dmInd->status,
                         NULL,
                         NULL);
}

void CmCsLeDefaultSettingsReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsDefaultSettingsReq *req = (CmLeCsDefaultSettingsReq *) cmData->recvMsgP;
    DM_ULP_CS_DEFAULT_SETTINGS_REQ_T *dmPrim = zpnew(DM_ULP_CS_DEFAULT_SETTINGS_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_DEFAULT_SETTINGS_REQ);
    dmPrim->type = DM_ULP_CS_DEFAULT_SETTINGS_REQ;
    dmPrim->addrt = req->addrt;
    dmPrim->role_enable = req->roleEnable;
    dmPrim->cs_sync_antenna_selection = req->csSyncAntennaSelection;
    dmPrim->max_tx_power = req->maxTxPower;

    DM_PutMsg(dmPrim);
}

void CmCsLeDefaultSettingsCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_DEFAULT_SETTINGS_CFM_T *dmCfm = (DM_ULP_CS_DEFAULT_SETTINGS_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_DEFAULT_SETTINGS_REQ);
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsDefaultSettingsCfm *cfm = (CmLeCsDefaultSettingsCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_DEFAULT_SETTINGS_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeReadRemoteFAETableReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsReadRemoteFaeTableReq *req = (CmLeCsReadRemoteFaeTableReq *) cmData->recvMsgP;
    DM_HCI_ULP_CS_READ_REMOTE_FAE_TABLE_REQ_T *dmPrim = zpnew(DM_HCI_ULP_CS_READ_REMOTE_FAE_TABLE_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_READ_REMOTE_FAE_TABLE_REQ);
    dmPrim->common.op_code = DM_HCI_ULP_CS_READ_REMOTE_FAE_TABLE_REQ;
    dmPrim->addrt = req->addrt;

    DM_PutMsg(dmPrim);
}

void CmCsLeReadRemoteFAETableCfmHandler(cmInstanceData_t *cmData)
{
    DM_HCI_ULP_CS_READ_REMOTE_FAE_TABLE_CFM_T *dmCfm = (DM_HCI_ULP_CS_READ_REMOTE_FAE_TABLE_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_READ_REMOTE_FAE_TABLE_REQ);
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsReadRemoteFaeTableCfm *cfm = (CmLeCsReadRemoteFaeTableCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_READ_REMOTE_FAE_TABLE_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        SynMemMoveS(cfm->remoteFaeTable, CS_FAE_TABLE_SIZE,
                    dmCfm->remote_fae_table, CS_FAE_TABLE_SIZE);

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeWriteCachedRemoteFAETableReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsWriteCachedRemoteFaeTableReq *req = (CmLeCsWriteCachedRemoteFaeTableReq *) cmData->recvMsgP;
    DM_HCI_ULP_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ_T *dmPrim = zpnew(DM_HCI_ULP_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ);
    dmPrim->common.op_code = DM_HCI_ULP_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ;
    dmPrim->addrt = req->addrt;
    SynMemMoveS(dmPrim->remote_fae_table, sizeof(dmPrim->remote_fae_table),
                req->remoteFaeTable, sizeof(dmPrim->remote_fae_table));

    DM_PutMsg(dmPrim);
}

void CmCsLeWriteCachedRemoteFAETableCfmHandler(cmInstanceData_t *cmData)
{
    DM_HCI_ULP_CS_WRITE_CACHED_REMOTE_FAE_TABLE_CFM_T *dmCfm = (DM_HCI_ULP_CS_WRITE_CACHED_REMOTE_FAE_TABLE_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE_REQ);
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsWriteCachedRemoteFaeTableCfm *cfm = (CmLeCsWriteCachedRemoteFaeTableCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_WRITE_CACHED_REMOTE_FAE_TABLE_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeCreateConfigReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsCreateConfigReq *req = (CmLeCsCreateConfigReq *) cmData->recvMsgP;
    DM_ULP_CS_CREATE_CONFIG_REQ_T *dmPrim = zpnew(DM_ULP_CS_CREATE_CONFIG_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_CREATE_CONFIG_REQ);

    dmPrim->type                        = DM_ULP_CS_CREATE_CONFIG_REQ;
    dmPrim->addrt                       = req->addrt;
    dmPrim->config_id                   = req->configId;
    dmPrim->create_context              = req->createContext;

    SynMemMoveS(&dmPrim->dm_cs_config_params, sizeof(dmPrim->dm_cs_config_params),
                &req->configParams, sizeof(req->configParams));

    DM_PutMsg(dmPrim);
}

void CmCsLeCreateConfigCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_CREATE_CONFIG_CFM_T *dmCfm = (DM_ULP_CS_CREATE_CONFIG_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_CREATE_CONFIG_REQ);
    params.addrt = dmCfm->addrt;
    params.configId = dmCfm->config_id;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsCreateConfigCfm *cfm = (CmLeCsCreateConfigCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type                       = CM_LE_CS_CREATE_CONFIG_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt                      = dmCfm->addrt;
        cfm->configId                   = dmCfm->config_id;
        cfm->action                     = dmCfm->action;
        cfm->mainModeType               = dmCfm->main_mode_type;
        cfm->subModeType                = dmCfm->sub_mode_type;
        cfm->minMainModeSteps           = dmCfm->min_main_mode_steps;
        cfm->maxMainModeSteps           = dmCfm->max_main_mode_steps;
        cfm->mainModeRepetition         = dmCfm->main_mode_repetition;
        cfm->mode0Steps                 = dmCfm->mode_0_steps;
        cfm->role                       = dmCfm->role;
        cfm->rttType                    = dmCfm->rtt_type;
        cfm->csSyncPhy                  = dmCfm->cs_sync_phy;
        SynMemMoveS(dmCfm->channel_map, CS_CHANNEL_MAP_SIZE, 
                    cfm->channelMap, CS_CHANNEL_MAP_SIZE);
        cfm->channelMapRepetition       = dmCfm->channel_map_repetition;
        cfm->channelSelectionType       = dmCfm->channel_selection_type;
        cfm->ch3cShape                  = dmCfm->ch3c_shape;
        cfm->ch3cJump                   = dmCfm->ch3c_jump;
        cfm->tIp1Time                   = dmCfm->t_ip1_time;
        cfm->tIp2Time                   = dmCfm->t_ip2_time;
        cfm->tFcsTime                   = dmCfm->t_fcs_time;
        cfm->tPmTime                    = dmCfm->t_pm_time;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeCreateConfigIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_CREATE_CONFIG_IND_T *dmInd = (DM_ULP_CS_CREATE_CONFIG_IND_T *) cmData->recvMsgP;

    CsrBtCmPropgateEvent(cmData,
                         CmPropogateCsCreateConfigInd,
                         CM_EVENT_MASK_SUBSCRIBE_CHANNEL_SOUNDING_IND,
                         dmInd->status,
                         NULL,
                         NULL);
}

void CmCsLeRemoveConfigReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsRemoveConfigReq *req = (CmLeCsRemoveConfigReq *) cmData->recvMsgP;
    DM_ULP_CS_REMOVE_CONFIG_REQ_T *dmPrim = zpnew(DM_ULP_CS_REMOVE_CONFIG_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_REMOVE_CONFIG_REQ);

    dmPrim->type                    = DM_ULP_CS_REMOVE_CONFIG_REQ;
    dmPrim->addrt                   = req->addrt;
    dmPrim->config_id               = req->configId;

    DM_PutMsg(dmPrim);
}

void CmCsLeRemoveConfigCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_REMOVE_CONFIG_CFM_T *dmCfm = (DM_ULP_CS_REMOVE_CONFIG_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_REMOVE_CONFIG_REQ);
    params.configId = dmCfm->config_id;
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsRemoveConfigCfm *cfm = (CmLeCsRemoveConfigCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type                       = CM_LE_CS_REMOVE_CONFIG_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt                      = dmCfm->addrt;
        cfm->configId                   = dmCfm->config_id;
        cfm->action                     = dmCfm->action;
        cfm->mainModeType               = dmCfm->main_mode_type;
        cfm->subModeType                = dmCfm->sub_mode_type;
        cfm->minMainModeSteps           = dmCfm->min_main_mode_steps;
        cfm->maxMainModeSteps           = dmCfm->max_main_mode_steps;
        cfm->mainModeRepetition         = dmCfm->main_mode_repetition;
        cfm->mode0Steps                 = dmCfm->mode_0_steps;
        cfm->role                       = dmCfm->role;
        cfm->rttType                    = dmCfm->rtt_type;
        cfm->csSyncPhy                  = dmCfm->cs_sync_phy;
        SynMemMoveS(dmCfm->channel_map, CS_CHANNEL_MAP_SIZE, 
                    cfm->channelMap, CS_CHANNEL_MAP_SIZE);
        cfm->channelMapRepetition       = dmCfm->channel_map_repetition;
        cfm->channelSelectionType       = dmCfm->channel_selection_type;
        cfm->ch3cShape                  = dmCfm->ch3c_shape;
        cfm->ch3cJump                   = dmCfm->ch3c_jump;
        cfm->tIp1Time                   = dmCfm->t_ip1_time;
        cfm->tIp2Time                   = dmCfm->t_ip2_time;
        cfm->tFcsTime                   = dmCfm->t_fcs_time;
        cfm->tPmTime                    = dmCfm->t_pm_time;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeRemoveConfigIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_CREATE_CONFIG_IND_T *dmInd = (DM_ULP_CS_CREATE_CONFIG_IND_T *) cmData->recvMsgP;

    CsrBtCmPropgateEvent(cmData,
                         CmPropogateCsRemoveConfigInd,
                         CM_EVENT_MASK_SUBSCRIBE_CHANNEL_SOUNDING_IND,
                         dmInd->status,
                         NULL,
                         NULL);
}

void CmCsLeSetChannelClassificationReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsSetChannelClassificationReq *req = (CmLeCsSetChannelClassificationReq *) cmData->recvMsgP;
    DM_HCI_ULP_CS_SET_CHANNEL_CLASSIFICATION_REQ_T *dmPrim = zpnew(DM_HCI_ULP_CS_SET_CHANNEL_CLASSIFICATION_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_SET_CHANNEL_CLASSIFICATION_REQ);

    dmPrim->common.op_code              = DM_HCI_ULP_CS_SET_CHANNEL_CLASSIFICATION_REQ;
    SynMemMoveS(dmPrim->channel_classification, CS_CHANNEL_CLASSIFICATION_SIZE, 
                req->channelClassification, CS_CHANNEL_CLASSIFICATION_SIZE);

    DM_PutMsg(dmPrim);
}

void CmCsLeSetChannelClassificationCfmHandler(cmInstanceData_t *cmData)
{
    DM_HCI_ULP_CS_SET_CHANNEL_CLASSIFICATION_CFM_T *dmCfm = (DM_HCI_ULP_CS_SET_CHANNEL_CLASSIFICATION_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_SET_CHANNEL_CLASSIFICATION_REQ);
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsSetChannelClassificationCfm *cfm = (CmLeCsSetChannelClassificationCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_SET_CHANNEL_CLASSIFICATION_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeSetProcedureParametersReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsSetProcedureParametersReq *req = (CmLeCsSetProcedureParametersReq *) cmData->recvMsgP;
    DM_ULP_CS_SET_PROCEDURE_PARAMETERS_REQ_T *dmPrim = zpnew(DM_ULP_CS_SET_PROCEDURE_PARAMETERS_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_SET_PROCEDURE_PARAMETERS_REQ);

    dmPrim->type                            = DM_ULP_CS_SET_PROCEDURE_PARAMETERS_REQ;
    dmPrim->addrt                           = req->addrt;
    dmPrim->config_id                       = req->configId;

    SynMemMoveS(&dmPrim->dm_cs_procedure_params, sizeof(dmPrim->dm_cs_procedure_params),
                &req->csProcedureParam, sizeof(req->csProcedureParam));

    DM_PutMsg(dmPrim);
}

void CmCsLeSetProcedureParametersCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_SET_PROCEDURE_PARAMETERS_CFM_T *dmCfm = (DM_ULP_CS_SET_PROCEDURE_PARAMETERS_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_SET_PROCEDURE_PARAMETERS_REQ);
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsSetProcedureParametersCfm *cfm = (CmLeCsSetProcedureParametersCfm *) CsrPmemZalloc(sizeof(*cfm));

        cfm->type = CM_LE_CS_SET_PROCEDURE_PARAMETERS_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);
        cfm->addrt = dmCfm->addrt;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeProcedureEnableReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsProcedureEnableReq *req = (CmLeCsProcedureEnableReq *) cmData->recvMsgP;
    DM_ULP_CS_PROCEDURE_ENABLE_REQ_T *dmPrim = zpnew(DM_ULP_CS_PROCEDURE_ENABLE_REQ_T);

    cmCsAddPendingMsg(cmData, CM_LE_CS_PROCEDURE_ENABLE_REQ);

    dmPrim->type                            = DM_ULP_CS_PROCEDURE_ENABLE_REQ;
    dmPrim->addrt                           = req->addrt;
    dmPrim->config_id                       = req->configId;
    dmPrim->enable                          = req->enable;

    DM_PutMsg(dmPrim);
}

#ifdef CSR_STREAMS_ENABLE
static void cmCsLeStreamRegister(cmInstanceData_t *cmData)
{
    DM_ULP_CS_PROCEDURE_ENABLE_CFM_T *dmPrim = (DM_ULP_CS_PROCEDURE_ENABLE_CFM_T *) cmData->recvMsgP;

    if (dmPrim->state == CM_CS_PROC_ENABLE)
    {
        /* Procedure is enabled, register for the source. */
        Source src = vm_trap_StreamChannelSoundingSource();

        if (SourceIsValid(src) && src != cmData->csEventSource)
        {
            cmData->csEventSource = src;
            SynergyStreamsSourceRegister(CSR_BT_CM_IFACEQUEUE, cmData->csEventSource);
        }
    }
    else /* Procedure is getting disabled, flush the source and set it to invalid.*/
    {
        if (SourceIsValid(cmData->csEventSource))
        {
            CmStreamFlushSource(cmData->csEventSource);
            cmData->csEventSource = 0;
            cmData->csMmdProcessed = FALSE;
        }
    }
}
#endif /* CSR_STREAMS_ENABLE */

void CmCsLeProcedureEnableCfmHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_PROCEDURE_ENABLE_CFM_T *dmCfm = (DM_ULP_CS_PROCEDURE_ENABLE_CFM_T *) cmData->recvMsgP;
    CmCsCommonParams params;
    cmPendingMsg_t *pendingMsg;

    cmCsLeSetSearchParameters(&params, CM_LE_CS_PROCEDURE_ENABLE_REQ);
    params.configId = dmCfm->config_id; 
    params.addrt = dmCfm->addrt;
    pendingMsg = cmCsGetPendingMsg(cmData, &params);

    if (pendingMsg)
    {
        CmLeCsProcedureEnableCfm *cfm = (CmLeCsProcedureEnableCfm *) CsrPmemZalloc(sizeof(*cfm));

#ifdef CSR_STREAMS_ENABLE
        cmCsLeStreamRegister(cmData);
#endif /* CSR_STREAMS_ENABLE */

        cfm->type = CM_LE_CS_PROCEDURE_ENABLE_CFM;
        cfm->resultCode = (dmCfm->status == HCI_SUCCESS ? CSR_BT_RESULT_CODE_CM_SUCCESS: dmCfm->status);
        cfm->resultSupplier = (dmCfm->status == HCI_SUCCESS ? CSR_BT_SUPPLIER_CM: CSR_BT_SUPPLIER_HCI);

        cfm->addrt                          = dmCfm->addrt;
        cfm->configId                       = dmCfm->config_id;
        cfm->state                          = dmCfm->state;
        cfm->toneAntennaConfigSelection     = dmCfm->tone_antenna_config_selection;
        cfm->selectedTxPower                = dmCfm->selected_tx_power;
        cfm->subeventLen                    = dmCfm->subevent_len;
        cfm->subeventsPerEvent              = dmCfm->subevents_per_event;
        cfm->subeventInterval               = dmCfm->subevent_interval;
        cfm->eventInterval                  = dmCfm->event_interval;
        cfm->procedureInterval              = dmCfm->procedure_interval;
        cfm->procedureCount                 = dmCfm->procedure_count;
        cfm->maxProcedureLen                = dmCfm->max_procedure_len;

        CsrBtCmPutMessage(pendingMsg->arg.csParams.appHandle, cfm);
        CsrPCmnListRemove(cmData->pendingMsgs, (CsrCmnListElm_t* ) pendingMsg);
    }
}

void CmCsLeProcedureEnableIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_PROCEDURE_ENABLE_IND_T *dmInd = (DM_ULP_CS_PROCEDURE_ENABLE_IND_T *) cmData->recvMsgP;

#ifdef CSR_STREAMS_ENABLE
    cmCsLeStreamRegister(cmData);
#endif /* CSR_STREAMS_ENABLE */

    CsrBtCmPropgateEvent(cmData,
                         CmPropogateCsProcedureEnableInd,
                         CM_EVENT_MASK_SUBSCRIBE_CHANNEL_SOUNDING_IND,
                         dmInd->status,
                         NULL,
                         NULL);
}

void CmCsLeSubeventResultIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_SUBEVENT_RESULT_IND_T *dmInd = (DM_ULP_CS_SUBEVENT_RESULT_IND_T *) cmData->recvMsgP;
    CmLeCsSubeventResultInd *resultInd;

#ifdef CSR_STREAMS_ENABLE
    const CsrUint8 *sourcePtr = NULL;
    CsrUint16 sourceSize = 0;

    if (!SourceIsValid(cmData->csEventSource))
    {
        CSR_LOG_TEXT_INFO((CsrBtCmLto, 0, "CmCsLeSubeventResultIndHandler cmData->csEventSource=%p result NOT processing",
                            cmData->csEventSource));
        return;
    }
#endif /* CSR_STREAMS_ENABLE */

    resultInd  = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*resultInd));

    resultInd->type                           = CM_LE_CS_SUBEVENT_RESULT_IND;
    resultInd->resultCode                     = CSR_BT_RESULT_CODE_CM_SUCCESS;
    resultInd->resultSupplier                 = CSR_BT_SUPPLIER_CM;
    resultInd->addrt                          = dmInd->addrt;
    resultInd->configId                       = dmInd->config_id;
    resultInd->startAclConnEventCounter       = dmInd->start_acl_conn_event_counter;
    resultInd->procedureCounter               = dmInd->procedure_counter;
    resultInd->frequencyCompensation          = dmInd->frequency_compensation;
    resultInd->referencePowerLevel            = dmInd->reference_power_level;
    resultInd->procedureDoneStatus            = dmInd->procedure_done_status;
    resultInd->subeventDoneStatus             = dmInd->subevent_done_status;
    resultInd->abortReason                    = dmInd->abort_reason;
    resultInd->numAntennaPaths                = dmInd->num_antenna_paths;
    resultInd->numStepsReported               = dmInd->num_steps_reported;

#ifdef CSR_STREAMS_ENABLE
    sourcePtr = SourceMap(cmData->csEventSource);
    sourceSize = SourceBoundary(cmData->csEventSource);

    if (sourceSize)
    {
        resultInd->stepsDataLen = sourceSize;
        resultInd->steps = (CsrUint8*) sourcePtr;
    }
#else
    if (dmInd->steps)
    {
        resultInd->steps                      = (CsrUint8*) dmInd->steps;
        resultInd->stepsDataLen               = dmInd->steps_data_len;
    }
#endif /* CSR_STREAMS_ENABLE */

/* Sending subevent indications to the registered module as owner of CS.*/
    CsrBtCmPutMessage(cmData->csHandle, resultInd);
}

void CmCsLeSubeventResultContinueIndHandler(cmInstanceData_t *cmData)
{
    DM_ULP_CS_SUBEVENT_RESULT_CONTINUE_IND_T *dmInd = (DM_ULP_CS_SUBEVENT_RESULT_CONTINUE_IND_T *) cmData->recvMsgP;
    CmLeCsSubeventResultContinueInd *resultContInd;

#ifdef CSR_STREAMS_ENABLE
    const CsrUint8 *sourcePtr = NULL;
    CsrUint16 sourceSize = 0;

    if (!SourceIsValid(cmData->csEventSource))
    {
        CSR_LOG_TEXT_INFO((CsrBtCmLto, 0, "CmCsLeSubeventResultContinueIndHandler cmData->csEventSource=%p result NOT processing", cmData->csEventSource));
        return;
    }
#endif /* CSR_STREAMS_ENABLE */
    resultContInd = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*resultContInd));

    resultContInd->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
    resultContInd->resultCode = CSR_BT_RESULT_CODE_CM_SUCCESS;
    resultContInd->resultSupplier = CSR_BT_SUPPLIER_CM;

    resultContInd->addrt                          = dmInd->addrt;
    resultContInd->configId                       = dmInd->config_id;
    resultContInd->procedureDoneStatus            = dmInd->procedure_done_status;
    resultContInd->subeventDoneStatus             = dmInd->subevent_done_status;
    resultContInd->abortReason                    = dmInd->abort_reason;
    resultContInd->numAntennaPaths                = dmInd->num_antenna_paths;
    resultContInd->numStepsReported               = dmInd->num_steps_reported;
    resultContInd->stepsDataLen                   = dmInd->steps_data_len;

#ifdef CSR_STREAMS_ENABLE
    sourcePtr = SourceMap(cmData->csEventSource);
    sourceSize = SourceBoundary(cmData->csEventSource);

    if (sourceSize)
    {
        resultContInd->stepsDataLen = sourceSize;
        resultContInd->steps = (CsrUint8*) sourcePtr;
    }
#else
    if (dmInd->steps)
    {
        resultContInd->steps                      = (CsrUint8*) dmInd->steps;
        resultContInd->stepsDataLen               = dmInd->steps_data_len;
    }
#endif /* CSR_STREAMS_ENABLE */

/* Sending subevent continue indications to the registered module as owner of CS.*/
    CsrBtCmPutMessage(cmData->csHandle, resultContInd);
}

/* Below implementation is to simulate subevents just for interface verification and shall be removed.*/

static CsrBtTypedAddr simulationBdAddress;

/* Multiple subevents Mode 1 */

#define CM_FULL_BUFFER_LEN 149
#define CM_PARTIAL_BUFFER_LEN 77
#define CM_TOTAL_EVENT_BUFFERS 7

#define CM_SUBEVENT_INTERVAL_IN_SECS (1 * CSR_SCHED_SECOND)

CsrUint8 eventBuffer1[CM_FULL_BUFFER_LEN] = {0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc2, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x40, 0x03, 0x00, 0xac, 0x00, 0x00, 0x1a, 0x03, 0x00, 0xae, 0x00, 0x00, 0x1c, 0x03, 0x00, 0xad, 0x00, 0x01, 0x28, 0x06, 0x00, 0x00, 0xa9, 0xe5, 0xfe, 0x00, 0x01, 0x35, 0x06, 0x00, 0x00, 0xaa, 0xb2, 0xfe, 0x00, 0x01, 0x44, 0x06, 0x00, 0x00, 0xaa, 0xcc, 0xfe, 0x00, 0x01, 0x34, 0x06, 0x00, 0x00, 0xa9, 0xcb, 0xfe, 0x00, 0x01, 0x40, 0x06, 0x00, 0x00, 0xaa, 0xd7, 0xfe, 0x00, 0x01, 0x25, 0x06, 0x00, 0x00, 0xaa, 0xc4, 0xfe, 0x00, 0x01, 0x3f, 0x06, 0x00, 0x00, 0xaa, 0xe4, 0xfe, 0x00, 0x01, 0x49, 0x06, 0x00, 0x00, 0xa9, 0xcf, 0xfe, 0x00, 0x01, 0x06, 0x06, 0x00, 0x00, 0xaa, 0xc9, 0xfe, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0xaa, 0xf8, 0xfe, 0x00, 0x01, 0x1a, 0x06, 0x00, 0x00, 0xab, 0xc2, 0xfe, 0x00, 0x01, 0x15, 0x06, 0x00, 0x00, 0xab, 0xc7, 0xfe, 0x00, 0x01, 0x1f, 0x06, 0x00, 0x00, 0xab, 0xca, 0xfe, 0x00};
CsrUint8 eventBuffer2[CM_FULL_BUFFER_LEN] = {0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbe, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x44, 0x03, 0x00, 0xac, 0x00, 0x00, 0x45, 0x03, 0x00, 0xab, 0x00, 0x00, 0x22, 0x03, 0x00, 0xac, 0x00, 0x01, 0x15, 0x06, 0x00, 0x00, 0xab, 0x29, 0xff, 0x00, 0x01, 0x1f, 0x06, 0x00, 0x00, 0xab, 0x23, 0xff, 0x00, 0x01, 0x3e, 0x06, 0x00, 0x00, 0xaa, 0x24, 0xff, 0x00, 0x01, 0x2d, 0x06, 0x00, 0x00, 0xa9, 0x58, 0xff, 0x00, 0x01, 0x05, 0x06, 0x00, 0x00, 0xa9, 0x2d, 0xff, 0x00, 0x01, 0x36, 0x06, 0x00, 0x00, 0xa9, 0x4e, 0xff, 0x00, 0x01, 0x0e, 0x06, 0x00, 0x00, 0xaa, 0x60, 0xff, 0x00, 0x01, 0x2f, 0x06, 0x00, 0x00, 0xa9, 0x13, 0xff, 0x00, 0x01, 0x12, 0x06, 0x00, 0x00, 0xab, 0x55, 0xff, 0x00, 0x01, 0x11, 0x06, 0x00, 0x00, 0xab, 0x1f, 0xff, 0x00, 0x01, 0x41, 0x06, 0x00, 0x00, 0xaa, 0x16, 0xff, 0x00, 0x01, 0x0d, 0x06, 0x00, 0x00, 0xaa, 0x4d, 0xff, 0x00, 0x01, 0x39, 0x06, 0x00, 0x00, 0xaa, 0x44, 0xff, 0x00};
CsrUint8 eventBuffer3[CM_FULL_BUFFER_LEN] = {0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbd, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x23, 0x03, 0x00, 0xac, 0x00, 0x00, 0x14, 0x03, 0x00, 0xad, 0x00, 0x00, 0x25, 0x03, 0x00, 0xac, 0x00, 0x01, 0x0d, 0x06, 0x00, 0x00, 0xaa, 0xd7, 0xff, 0x00, 0x01, 0x39, 0x06, 0x00, 0x00, 0xaa, 0xbc, 0xff, 0x00, 0x01, 0x30, 0x06, 0x00, 0x00, 0xaa, 0xee, 0xff, 0x00, 0x01, 0x3d, 0x06, 0x00, 0x00, 0xaa, 0xc1, 0xff, 0x00, 0x01, 0x04, 0x06, 0x00, 0x00, 0xaa, 0xf4, 0xff, 0x00, 0x01, 0x43, 0x06, 0x00, 0x00, 0xaa, 0xbb, 0xff, 0x00, 0x01, 0x37, 0x06, 0x00, 0x00, 0xaa, 0xb9, 0xff, 0x00, 0x01, 0x09, 0x06, 0x00, 0x00, 0xaa, 0xe4, 0xff, 0x00, 0x01, 0x22, 0x06, 0x00, 0x00, 0xaa, 0xf5, 0xff, 0x00, 0x01, 0x1e, 0x06, 0x00, 0x00, 0xaa, 0xce, 0xff, 0x00, 0x01, 0x2a, 0x06, 0x00, 0x00, 0xa9, 0xd0, 0xff, 0x00, 0x01, 0x07, 0x06, 0x00, 0x00, 0xaa, 0xca, 0xff, 0x00, 0x01, 0x26, 0x06, 0x00, 0x00, 0xa9, 0xaf, 0xff, 0x00};
CsrUint8 eventBuffer4[CM_FULL_BUFFER_LEN] = {0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbd, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x0e, 0x03, 0x00, 0xac, 0x00, 0x00, 0x28, 0x03, 0x00, 0xac, 0x00, 0x00, 0x0a, 0x03, 0x00, 0xac, 0x00, 0x01, 0x07, 0x06, 0x00, 0x00, 0xaa, 0x43, 0xff, 0x00, 0x01, 0x26, 0x06, 0x00, 0x00, 0xa9, 0x25, 0xff, 0x00, 0x01, 0x29, 0x06, 0x00, 0x00, 0xaa, 0x43, 0xff, 0x00, 0x01, 0x02, 0x06, 0x00, 0x00, 0xaa, 0x23, 0xff, 0x00, 0x01, 0x45, 0x06, 0x00, 0x00, 0xab, 0x46, 0xff, 0x00, 0x01, 0x48, 0x06, 0x00, 0x00, 0xa9, 0x38, 0xff, 0x00, 0x01, 0x42, 0x06, 0x00, 0x00, 0xaa, 0x4e, 0xff, 0x00, 0x01, 0x4a, 0x06, 0x00, 0x00, 0xaa, 0x2d, 0xff, 0x00, 0x01, 0x24, 0x06, 0x00, 0x00, 0xa9, 0x1b, 0xff, 0x00, 0x01, 0x3a, 0x06, 0x00, 0x00, 0xaa, 0x18, 0xff, 0x00, 0x01, 0x1c, 0x06, 0x00, 0x00, 0xab, 0x35, 0xff, 0x00, 0x01, 0x16, 0x06, 0x00, 0x00, 0xaa, 0x45, 0xff, 0x00, 0x01, 0x1d, 0x06, 0x00, 0x00, 0xab, 0x48, 0xff, 0x00};
CsrUint8 eventBuffer5[CM_FULL_BUFFER_LEN] = {0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbd, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x3c, 0x03, 0x00, 0xac, 0x00, 0x00, 0x1e, 0x03, 0x00, 0xae, 0x00, 0x00, 0x20, 0x03, 0x00, 0xac, 0x00, 0x01, 0x16, 0x06, 0x00, 0x00, 0xab, 0xc3, 0xff, 0x00, 0x01, 0x1d, 0x06, 0x00, 0x00, 0xab, 0xb1, 0xff, 0x00, 0x01, 0x4c, 0x06, 0x00, 0x00, 0xa9, 0xa5, 0xff, 0x00, 0x01, 0x21, 0x06, 0x00, 0x00, 0xaa, 0xc5, 0xff, 0x00, 0x01, 0x0b, 0x06, 0x00, 0x00, 0xa9, 0xcd, 0xff, 0x00, 0x01, 0x10, 0x06, 0x00, 0x00, 0xab, 0xb3, 0xff, 0x00, 0x01, 0x2b, 0x06, 0x00, 0x00, 0xa9, 0xb0, 0xff, 0x00, 0x01, 0x3c, 0x06, 0x00, 0x00, 0xaa, 0xd5, 0xff, 0x00, 0x01, 0x20, 0x06, 0x00, 0x00, 0xaa, 0x95, 0xff, 0x00, 0x01, 0x2e, 0x06, 0x00, 0x00, 0xa8, 0x94, 0xff, 0x00, 0x01, 0x47, 0x06, 0x00, 0x00, 0xaa, 0xbd, 0xff, 0x00, 0x01, 0x33, 0x06, 0x00, 0x00, 0xaa, 0xbd, 0xff, 0x00, 0x01, 0x14, 0x06, 0x00, 0x00, 0xab, 0xed, 0xff, 0x00};
CsrUint8 eventBuffer6[CM_FULL_BUFFER_LEN] = {0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbe, 0x01, 0x00, 0x00, 0x01, 0x10, 0x87, 0x00, 0x2b, 0x03, 0x00, 0xab, 0x00, 0x00, 0x1f, 0x03, 0x00, 0xad, 0x00, 0x00, 0x29, 0x03, 0x00, 0xab, 0x00, 0x01, 0x33, 0x06, 0x00, 0x00, 0xa9, 0x4d, 0x00, 0x00, 0x01, 0x14, 0x06, 0x00, 0x00, 0xab, 0x5a, 0x00, 0x00, 0x01, 0x32, 0x06, 0x00, 0x00, 0xa9, 0x3f, 0x00, 0x00, 0x01, 0x2c, 0x06, 0x00, 0x00, 0xa9, 0x3f, 0x00, 0x00, 0x01, 0x46, 0x06, 0x00, 0x00, 0xa9, 0x3e, 0x00, 0x00, 0x01, 0x4b, 0x06, 0x00, 0x00, 0xa9, 0x42, 0x00, 0x00, 0x01, 0x13, 0x06, 0x00, 0x00, 0xab, 0x48, 0x00, 0x00, 0x01, 0x3b, 0x06, 0x00, 0x00, 0xaa, 0x1c, 0x00, 0x00, 0x01, 0x1b, 0x06, 0x00, 0x00, 0xab, 0x29, 0x00, 0x00, 0x01, 0x31, 0x06, 0x00, 0x00, 0xa9, 0x38, 0x00, 0x00, 0x01, 0x0f, 0x06, 0x00, 0x00, 0xaa, 0x18, 0x00, 0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0xa9, 0x0d, 0x00, 0x00, 0x01, 0x27, 0x06, 0x00, 0x00, 0xaa, 0x49, 0x00, 0x00};
CsrUint8 eventBuffer7[CM_PARTIAL_BUFFER_LEN] = {0x01, 0x81, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbe, 0x00, 0x00, 0x00, 0x01, 0x08, 0x3f, 0x00, 0x0b, 0x03, 0x00, 0xad, 0x00, 0x00, 0x49, 0x03, 0x00, 0xac, 0x00, 0x00, 0x21, 0x03, 0x00, 0xad, 0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0xaa, 0xc3, 0xff, 0x00, 0x01, 0x27, 0x06, 0x00, 0x00, 0xaa, 0xb0, 0xff, 0x00, 0x01, 0x0a, 0x06, 0x00, 0x00, 0xaa, 0xa9, 0xff, 0x00, 0x01, 0x23, 0x06, 0x00, 0x00, 0xaa, 0xad, 0xff, 0x00, 0x01, 0x0c, 0x06, 0x00, 0x00, 0xab, 0xd5, 0xff, 0x00};

CsrSchedTid subEventTimerId;
CsrSchedTid subEventTimerId1;
CsrUint8 subEventCurrentCounter = 0;

CsrUint8 *eventBuffer[] = 
{
    eventBuffer1,
    eventBuffer2,
    eventBuffer3,
    eventBuffer4,
    eventBuffer5,
    eventBuffer6,
    eventBuffer7
};

/* Single Subevent Mode 1
 */
#define CM_FULL_BUFFER_LEN2_1    230
#define CM_PARTIAL_BUFFER_LEN2_2 232
#define CM_PARTIAL_BUFFER_LEN2_3 223

#define CM_TOTAL_EVENT_BUFFERS2 3

CsrUint8 subEventCurrentCounter1 = 0;


CsrUint8 eventBuffer2_1[CM_FULL_BUFFER_LEN2_1] = {0x01, 0x3a, 0x00, 0x00, 0x01, 0x00, 0xc0, 0xf7, 0x01, 0x01, 0x00, 0x01, 0x19, 0xd8, 0x00, 0x11, 0x03, 0x00, 0xd3, 0x00, 0x00, 0x26, 0x03, 0x00, 0xd5, 0x00, 0x00, 0x22, 0x03, 0x00, 0xd4, 0x00, 0x01, 0x2c, 0x06, 0x00, 0x00, 0xd4, 0xcf, 0xfd, 0x00, 0x01, 0x3f, 0x06, 0x00, 0x00, 0xd4, 0xc0, 0xfd, 0x00, 0x01, 0x31, 0x06, 0x00, 0x00, 0xd3, 0xc3, 0xfd, 0x00, 0x01, 0x0f, 0x06, 0x00, 0x00, 0xd1, 0xd3, 0xfd, 0x00, 0x01, 0x02, 0x06, 0x00, 0x00, 0xd1, 0xcf, 0xfd, 0x00, 0x01, 0x3c, 0x06, 0x00, 0x00, 0xd3, 0xd8, 0xfd, 0x00, 0x01, 0x23, 0x06, 0x00, 0x00, 0xd4, 0xca, 0xfd, 0x00, 0x01, 0x2f, 0x06, 0x00, 0x00, 0xd4, 0xc0, 0xfd, 0x00, 0x01, 0x13, 0x06, 0x00, 0x00, 0xd2, 0xdc, 0xfd, 0x00, 0x01, 0x25, 0x06, 0x00, 0x00, 0xd4, 0xbd, 0xfd, 0x00, 0x01, 0x10, 0x06, 0x00, 0x00, 0xd2, 0xc1, 0xfd, 0x00, 0x01, 0x3a, 0x06, 0x00, 0x00, 0xd3, 0xcd, 0xfd, 0x00, 0x01, 0x1e, 0x06, 0x00, 0x00, 0xd4, 
                                                  0xcf, 0xfd, 0x00, 0x01, 0x36, 0x06, 0x00, 0x00, 0xd3, 0xb7, 0xfd, 0x00, 0x01, 0x0c, 0x06, 0x00, 0x00, 0xd2, 0xd9, 0xfd, 0x00, 0x01, 0x15, 0x06, 0x00, 0x00, 0xd2, 0xc5, 0xfd, 0x00, 0x01, 0x29, 0x06,0x00, 0x00, 0xd4, 0xa9, 0xfd, 0x00, 0x01, 0x1b, 0x06, 0x00, 0x00, 0xd3, 0xc0, 0xfd, 0x00, 0x01, 0x30,0x06, 0x00, 0x00, 0xd3, 0xe4, 0xfd, 0x00, 0x01, 0x2b, 0x06, 0x00, 0x00, 0xd3, 0xd1, 0xfd, 0x00, 0x01, 0x49, 0x06, 0x00, 0x00, 0xd5, 0xd1, 0xfd, 0x00, 0x01, 0x20, 0x06, 0x00, 0x00, 0xd5, 0xc7, 0xfd, 0x00};
CsrUint8 eventBuffer2_2[CM_PARTIAL_BUFFER_LEN2_2] = {0x01, 0x01, 0x01, 0x00, 0x01, 0x19, 0xE1, 0x01, 0x4b, 0x06, 0x00, 0x00, 0xd6, 0xc2, 0xfd, 0x00, 0x01, 0x22, 0x06, 0x00, 0x00, 0xd4, 0xc7, 0xfd, 0x00, 0x01, 0x12, 0x06, 0x00, 0x00, 0xd2, 0xd7, 0xfd, 0x00, 0x01, 0x2d, 0x06, 0x00, 0x00, 0xd3, 0xc6, 0xfd, 0x00, 0x01, 0x3e, 0x06, 0x00, 0x00, 0xd4, 0xcb, 0xfd, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0xd1, 0xd7, 0xfd, 0x00, 0x01, 0x45, 0x06, 0x00, 0x00, 0xd5, 0xc8, 0xfd, 0x00, 0x01, 0x0e, 0x06, 0x00, 0x00, 0xd2, 0xcb, 0xfd, 0x00, 0x01, 0x4a, 0x06, 0x00, 0x00, 0xd6, 0xe3, 0xfd, 0x00, 0x01, 0x07, 0x06, 0x00, 0x00, 0xd1, 0xe0, 0xfd, 0x00, 0x01, 0x4c, 0x06, 0x00, 0x00, 0xd6, 0xb4, 0xfd, 0x00, 0x01, 0x27, 0x06, 0x00, 0x00, 0xd4, 0xd8, 0xfd, 0x00, 0x01, 0x37, 0x06, 0x00, 0x00, 0xd3, 0xca, 0xfd, 0x00, 0x01, 0x14, 0x06, 0x00, 0x00, 0xd2, 0xd4, 0xfd, 0x00, 0x01, 0x33, 0x06, 0x00, 0x00, 0xd2, 0xd0, 0xfd, 0x00, 0x01, 0x11, 0x06,
                                                     0x00, 0x00, 0xd2, 0xe6, 0xfd, 0x00, 0x01, 0x44, 0x06, 0x00, 0x00, 0xd4, 0xd5, 0xfd, 0x00, 0x01, 0x05, 0x06, 0x00, 0x00, 0xd1, 0xd3, 0xfd, 0x00, 0x01, 0x0d, 0x06, 0x00, 0x00, 0xd1, 0xd7, 0xfd, 0x00, 0x01, 0x3b, 0x06, 0x00, 0x00, 0xd3, 0xd5, 0xfd, 0x00, 0x01, 0x1d, 0x06, 0x00, 0x00, 0xd4, 0xde, 0xfd, 0x00, 0x01, 0x48, 0x06, 0x00, 0x00, 0xd5, 0xce, 0xfd, 0x00, 0x01, 0x32, 0x06, 0x00, 0x00, 0xd3, 0xce, 0xfd, 0x00, 0x01, 0x0b, 0x06, 0x00, 0x00, 0xd2, 0x03, 0xfe, 0x00, 0x01, 0x40, 0x06, 0x00, 0x00, 0xd4, 0xc1, 0xfd, 0x00};
CsrUint8 eventBuffer2_3[CM_PARTIAL_BUFFER_LEN2_3] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x18, 0xD8, 0x01, 0x16, 0x06, 0x00, 0x00, 0xd3, 0xe1, 0xfd, 0x00, 0x01, 0x41, 0x06, 0x00, 0x00, 0xd4, 0xd5, 0xfd, 0x00, 0x01, 0x42, 0x06, 0x00, 0x00, 0xd4, 0xd3, 0xfd, 0x00, 0x01, 0x0a, 0x06, 0x00, 0x00, 0xd1, 0xf2, 0xfd, 0x00, 0x01, 0x26, 0x06, 0x00, 0x00, 0xd4, 0xcf, 0xfd, 0x00, 0x01, 0x1a, 0x06, 0x00, 0x00, 0xd3, 0xd4, 0xfd, 0x00, 0x01, 0x24, 0x06, 0x00, 0x00, 0xd5, 0xd4, 0xfd, 0x00, 0x01, 0x46, 0x06, 0x00, 0x00, 0xd5, 0xe0, 0xfd, 0x00, 0x01, 0x04, 0x06, 0x00, 0x00, 0xd2, 0xf1, 0xfd, 0x00, 0x01, 0x21, 0x06, 0x00, 0x00, 0xd4, 0xe8, 0xfd, 0x00, 0x01, 0x34, 0x06, 0x00, 0x00, 0xd3, 0xd1, 0xfd, 0x00, 0x01, 0x06, 0x06, 0x00, 0x00, 0xd2, 0xf9, 0xfd, 0x00, 0x01, 0x1f, 0x06, 0x00, 0x00, 0xd4, 0xe9, 0xfd, 0x00, 0x01, 0x47, 0x06, 0x00, 0x00, 0xd5, 0xec, 0xfd, 0x00, 0x01, 0x39, 0x06, 0x00, 0x00, 0xd3, 0xfc, 0xfd, 0x00, 0x01, 0x35, 0x06,
                                                     0x00, 0x00, 0xd3, 0xdf, 0xfd, 0x00, 0x01, 0x43, 0x06, 0x00, 0x00, 0xd5, 0xeb, 0xfd, 0x00, 0x01, 0x2a, 0x06, 0x00, 0x00, 0xd4, 0xd4, 0xfd, 0x00, 0x01, 0x1c, 0x06, 0x00, 0x00, 0xd4, 0xd0, 0xfd, 0x00, 0x01, 0x3d, 0x06, 0x00, 0x00, 0xd3, 0xe4, 0xfd, 0x00, 0x01, 0x2e, 0x06, 0x00, 0x00, 0xd4, 0xe3, 0xfd, 0x00, 0x01, 0x09, 0x06, 0x00, 0x00, 0xd1, 0x10, 0xfe, 0x00, 0x01, 0x28, 0x06, 0x00, 0x00, 0xd5, 0xd2, 0xfd, 0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0xd1, 0xf2, 0xfd, 0x00};

CsrUint8 *eventBuffer2_x[] = 
{
    eventBuffer2_1,
    eventBuffer2_2,
    eventBuffer2_3
};

#define SUBEVENT32 1

#ifdef SUBEVENT32

#define CM_SUBEVENT_INTERVAL_IN_SECS_3 (1 * CSR_SCHED_SECOND)

CsrSchedTid subEventTimerId3;

#define CM_FULL_BUFFER_LEN3_1    53

#define CM_TOTAL_EVENT_BUFFERS3 32

CsrUint8 subEventCurrentCounter3 = 0;

/* Make Procedure status as 0x00 TO indicate Procedure is complte for short segment test i.e 0x00 after 0x17 */
CsrUint8 eventBuffer3_1[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x17,0x00,0x00,0x00,0x01,0x05, 0x27 ,0x00,0x06,0x03,0x00,0xf3,0x01,0x00,0x04,0x03,0x00,0xf3,0x01,0x01,0x2b,0x06,0x00,0x00,0xf6,0x29,0x00,0x01,0x01,0x42,0x06,0x00,0x00,0xf6,0x51,0x00,0x01,0x01,0x3d,0x06,0x00,0x00,0xf5,0x41,0x00,0x01};
CsrUint8 eventBuffer3_2[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27, 0x00,0x39,0x03,0x00,0xf5,0x01,0x00,0x47,0x03,0x00,0xf7,0x01,0x01,0x42,0x06,0x00,0x00,0xf6,0x31,0x00,0x01,0x01,0x3d,0x06,0x00,0x00,0xf5,0x3a,0x00,0x01,0x01,0x41,0x06,0x00,0x00,0xf6,0x4d,0x00,0x01};
CsrUint8 eventBuffer3_3[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1b,0x01,0x00,0x00,0x01,0x05, 0x27, 0x00,0x4a,0x03,0x00,0xf8,0x01,0x00,0x09,0x03,0x00,0xf2,0x01,0x01,0x41,0x06,0x00,0x00,0xf6,0x26,0x00,0x01,0x01,0x3c,0x06,0x00,0x00,0xf5,0x26,0x00,0x01,0x01,0x27,0x06,0x00,0x00,0xf6,0x15,0x00,0x01};
CsrUint8 eventBuffer3_4[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x17,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x05,0x03,0x00,0xf3,0x01,0x00,0x30,0x03,0x00,0xf6,0x01,0x01,0x3c,0x06,0x00,0x00,0xf5,0x27,0x00,0x01,0x01,0x27,0x06,0x00,0x00,0xf6,0x0a,0x00,0x01,0x01,0x24,0x06,0x00,0x00,0xf6,0x11,0x00,0x01};
CsrUint8 eventBuffer3_5[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x23,0x03,0x00,0xf6,0x01,0x00,0x28,0x03,0x00,0xf6,0x01,0x01,0x24,0x06,0x00,0x00,0xf6,0x0e,0x00,0x01,0x01,0x4a,0x06,0x00,0x00,0xf8,0x1d,0x00,0x01,0x01,0x0d,0x06,0x00,0x00,0xf3,0x19,0x00,0x01};
CsrUint8 eventBuffer3_6[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x08,0x03,0x00,0xf3,0x01,0x00,0x40,0x03,0x00,0xf5,0x01,0x01,0x4a,0x06,0x00,0x00,0xf8,0x03,0x00,0x01,0x01,0x0d,0x06,0x00,0x00,0xf3,0x1a,0x00,0x01,0x01,0x44,0x06,0x00,0x00,0xf7,0x16,0x00,0x01};
CsrUint8 eventBuffer3_7[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x3e,0x03,0x00,0xf5,0x01,0x00,0x3d,0x03,0x00,0xf5,0x01,0x01,0x44,0x06,0x00,0x00,0xf7,0x19,0x00,0x01,0x01,0x47,0x06,0x00,0x00,0xf7,0xfd,0xff,0x01,0x01,0x13,0x06,0x00,0x00,0xf3,0x04,0x00,0x01};
CsrUint8 eventBuffer3_8[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x2a,0x03,0x00,0xf6,0x01,0x00,0x16,0x03,0x00,0xf3,0x01,0x01,0x47,0x06,0x00,0x00,0xf7,0xf6,0xff,0x01,0x01,0x13,0x06,0x00,0x00,0xf3,0xf6,0xff,0x01,0x01,0x2c,0x06,0x00,0x00,0xf6,0xe6,0xff,0x01};
CsrUint8 eventBuffer3_9[CM_FULL_BUFFER_LEN3_1] =  {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x2b,0x03,0x00,0xf6,0x01,0x00,0x02,0x03,0x00,0xf4,0x01,0x01,0x2c,0x06,0x00,0x00,0xf6,0xe7,0xff,0x01,0x01,0x4c,0x06,0x00,0x00,0xf8,0x01,0x00,0x01,0x01,0x29,0x06,0x00,0x00,0xf7,0xe2,0xff,0x01};
CsrUint8 eventBuffer3_10[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x36,0x03,0x00,0xf5,0x01,0x00,0x1a,0x03,0x00,0xf4,0x01,0x01,0x4c,0x06,0x00,0x00,0xf8,0xe7,0xff,0x01,0x01,0x29,0x06,0x00,0x00,0xf6,0xdb,0xff,0x01,0x01,0x3a,0x06,0x00,0x00,0xf5,0xef,0xff,0x01};
CsrUint8 eventBuffer3_11[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x21,0x03,0x00,0xf5,0x01,0x00,0x27,0x03,0x00,0xf6,0x01,0x01,0x3a,0x06,0x00,0x00,0xf5,0xe2,0xff,0x01,0x01,0x31,0x06,0x00,0x00,0xf6,0xde,0xff,0x01,0x01,0x15,0x06,0x00,0x00,0xf3,0xe4,0xff,0x01};
CsrUint8 eventBuffer3_12[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1b,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x49,0x03,0x00,0xf8,0x01,0x00,0x34,0x03,0x00,0xf5,0x01,0x01,0x31,0x06,0x00,0x00,0xf6,0xc5,0xff,0x01,0x01,0x15,0x06,0x00,0x00,0xf3,0xc8,0xff,0x01,0x01,0x33,0x06,0x00,0x00,0xf5,0xda,0xff,0x01};
CsrUint8 eventBuffer3_13[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x2d,0x03,0x00,0xf6,0x01,0x00,0x1e,0x03,0x00,0xf5,0x01,0x01,0x33,0x06,0x00,0x00,0xf6,0xcc,0xff,0x01,0x01,0x16,0x06,0x00,0x00,0xf3,0xd5,0xff,0x01,0x01,0x04,0x06,0x00,0x00,0xf4,0xce,0xff,0x01};
CsrUint8 eventBuffer3_14[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x42,0x03,0x00,0xf6,0x01,0x00,0x15,0x03,0x00,0xf3,0x01,0x01,0x16,0x06,0x00,0x00,0xf3,0xc4,0xff,0x01,0x01,0x04,0x06,0x00,0x00,0xf3,0xc3,0xff,0x01,0x01,0x35,0x06,0x00,0x00,0xf5,0xbe,0xff,0x01};
CsrUint8 eventBuffer3_15[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x2e,0x03,0x00,0xf6,0x01,0x00,0x37,0x03,0x00,0xf5,0x01,0x01,0x35,0x06,0x00,0x00,0xf5,0xbe,0xff,0x01,0x01,0x46,0x06,0x00,0x00,0xf7,0xba,0xff,0x01,0x01,0x1a,0x06,0x00,0x00,0xf4,0xb4,0xff,0x01};
CsrUint8 eventBuffer3_16[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x41,0x03,0x00,0xf6,0x01,0x00,0x43,0x03,0x00,0xf6,0x01,0x01,0x46,0x06,0x00,0x00,0xf7,0xbf,0xff,0x01,0x01,0x1a,0x06,0x00,0x00,0xf4,0xa8,0xff,0x01,0x01,0x3e,0x06,0x00,0x00,0xf5,0xae,0xff,0x01};
CsrUint8 eventBuffer3_17[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x0c,0x03,0x00,0xf2,0x01,0x00,0x32,0x03,0x00,0xf5,0x01,0x01,0x3e,0x06,0x00,0x00,0xf5,0xa3,0xff,0x01,0x01,0x0a,0x06,0x00,0x00,0xf3,0xa0,0xff,0x01,0x01,0x1b,0x06,0x00,0x00,0xf4,0x98,0xff,0x01};
CsrUint8 eventBuffer3_18[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x22,0x03,0x00,0xf5,0x01,0x00,0x3c,0x03,0x00,0xf5,0x01,0x01,0x0a,0x06,0x00,0x00,0xf3,0x99,0xff,0x01,0x01,0x1b,0x06,0x00,0x00,0xf4,0xa9,0xff,0x01,0x01,0x22,0x06,0x00,0x00,0xf6,0x9b,0xff,0x01};
CsrUint8 eventBuffer3_19[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x18,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x1c,0x03,0x00,0xf4,0x01,0x00,0x4c,0x03,0x00,0xf8,0x01,0x01,0x22,0x06,0x00,0x00,0xf6,0x94,0xff,0x01,0x01,0x36,0x06,0x00,0x00,0xf5,0x9e,0xff,0x01,0x01,0x37,0x06,0x00,0x00,0xf5,0x9b,0xff,0x01};
CsrUint8 eventBuffer3_20[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x1d,0x03,0x00,0xf4,0x01,0x00,0x12,0x03,0x00,0xf2,0x01,0x01,0x36,0x06,0x00,0x00,0xf5,0x91,0xff,0x01,0x01,0x37,0x06,0x00,0x00,0xf5,0x8a,0xff,0x01,0x01,0x26,0x06,0x00,0x00,0xf6,0x85,0xff,0x01};
CsrUint8 eventBuffer3_21[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x35,0x03,0x00,0xf5,0x01,0x00,0x0a,0x03,0x00,0xf2,0x01,0x01,0x26,0x06,0x00,0x00,0xf6,0x7c,0xff,0x01,0x01,0x06,0x06,0x00,0x00,0xf3,0x89,0xff,0x01,0x01,0x08,0x06,0x00,0x00,0xf3,0x86,0xff,0x01};
CsrUint8 eventBuffer3_22[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x2f,0x03,0x00,0xf6,0x01,0x00,0x24,0x03,0x00,0xf6,0x01,0x01,0x06,0x06,0x00,0x00,0xf3,0x90,0xff,0x01,0x01,0x08,0x06,0x00,0x00,0xf3,0x81,0xff,0x01,0x01,0x07,0x06,0x00,0x00,0xf3,0x86,0xff,0x01};
CsrUint8 eventBuffer3_23[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x45,0x03,0x00,0xf7,0x01,0x00,0x0b,0x03,0x00,0xf2,0x01,0x01,0x07,0x06,0x00,0x00,0xf3,0x89,0xff,0x01,0x01,0x3f,0x06,0x00,0x00,0xf6,0x79,0xff,0x01,0x01,0x2a,0x06,0x00,0x00,0xf6,0x73,0xff,0x01};
CsrUint8 eventBuffer3_24[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x17,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x14,0x03,0x00,0xf3,0x01,0x00,0x26,0x03,0x00,0xf6,0x01,0x01,0x3f,0x06,0x00,0x00,0xf6,0x79,0xff,0x01,0x01,0x2a,0x06,0x00,0x00,0xf6,0x6e,0xff,0x01,0x01,0x40,0x06,0x00,0x00,0xf6,0x71,0xff,0x01};
CsrUint8 eventBuffer3_25[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x31,0x03,0x00,0xf5,0x01,0x00,0x3f,0x03,0x00,0xf5,0x01,0x01,0x40,0x06,0x00,0x00,0xf6,0x62,0xff,0x01,0x01,0x32,0x06,0x00,0x00,0xf6,0x68,0xff,0x01,0x01,0x0e,0x06,0x00,0x00,0xf3,0x67,0xff,0x01};
CsrUint8 eventBuffer3_26[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x3b,0x03,0x00,0xf5,0x01,0x00,0x48,0x03,0x00,0xf7,0x01,0x01,0x32,0x06,0x00,0x00,0xf6,0x5d,0xff,0x01,0x01,0x0e,0x06,0x00,0x00,0xf3,0x66,0xff,0x01,0x01,0x48,0x06,0x00,0x00,0xf7,0x56,0xff,0x01};
CsrUint8 eventBuffer3_27[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x0e,0x03,0x00,0xf2,0x01,0x00,0x11,0x03,0x00,0xf2,0x01,0x01,0x48,0x06,0x00,0x00,0xf7,0x50,0xff,0x01,0x01,0x2e,0x06,0x00,0x00,0xf6,0x3e,0xff,0x01,0x01,0x12,0x06,0x00,0x00,0xf3,0x4f,0xff,0x01};
CsrUint8 eventBuffer3_28[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1b,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x4b,0x03,0x00,0xf8,0x01,0x00,0x03,0x03,0x00,0xf3,0x01,0x01,0x2e,0x06,0x00,0x00,0xf6,0x3b,0xff,0x01,0x01,0x12,0x06,0x00,0x00,0xf3,0x52,0xff,0x01,0x01,0x45,0x06,0x00,0x00,0xf7,0x49,0xff,0x01};
CsrUint8 eventBuffer3_29[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x13,0x03,0x00,0xf3,0x01,0x00,0x25,0x03,0x00,0xf6,0x01,0x01,0x45,0x06,0x00,0x00,0xf7,0x48,0xff,0x01,0x01,0x30,0x06,0x00,0x00,0xf6,0x38,0xff,0x01,0x01,0x0c,0x06,0x00,0x00,0xf3,0x4b,0xff,0x01};
CsrUint8 eventBuffer3_30[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x33,0x03,0x00,0xf5,0x01,0x00,0x3a,0x03,0x00,0xf5,0x01,0x01,0x30,0x06,0x00,0x00,0xf6,0x29,0xff,0x01,0x01,0x0c,0x06,0x00,0x00,0xf2,0x30,0xff,0x01,0x01,0x2f,0x06,0x00,0x00,0xf6,0x2c,0xff,0x01};
CsrUint8 eventBuffer3_31[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x18,0x01,0x00,0x00,0x01,0x05, 0x27,0x00,0x1b,0x03,0x00,0xf4,0x01,0x00,0x20,0x03,0x00,0xf5,0x01,0x01,0x2f,0x06,0x00,0x00,0xf6,0x30,0xff,0x01,0x01,0x1e,0x06,0x00,0x00,0xf5,0x1c,0xff,0x01,0x01,0x05,0x06,0x00,0x00,0xf3,0x2b,0xff,0x01};
CsrUint8 eventBuffer3_32[CM_FULL_BUFFER_LEN3_1] = {0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1b,0x00,0x00,0x00,0x01,0x05, 0x27,0x00,0x46,0x03,0x00,0xf7,0x01,0x00,0x29,0x03,0x00,0xf6,0x01,0x01,0x1e,0x06,0x00,0x00,0xf5,0x23,0xff,0x01,0x01,0x05,0x06,0x00,0x00,0xf3,0x1c,0xff,0x01,0x01,0x49,0x06,0x00,0x00,0xf8,0x22,0xff,0x01};

CsrUint8 *eventBuffer3_x[] = 
{
    eventBuffer3_1,
    eventBuffer3_2,
    eventBuffer3_3,
    eventBuffer3_4,
    eventBuffer3_5,
    eventBuffer3_6,
    eventBuffer3_7,
    eventBuffer3_8,
    eventBuffer3_9,
    eventBuffer3_10,
    eventBuffer3_11,
    eventBuffer3_12,
    eventBuffer3_13,
    eventBuffer3_14,
    eventBuffer3_15,
    eventBuffer3_16,
    eventBuffer3_17,
    eventBuffer3_18,
    eventBuffer3_19,
    eventBuffer3_20,
    eventBuffer3_21,
    eventBuffer3_22,
    eventBuffer3_23,
    eventBuffer3_24,
    eventBuffer3_25,
    eventBuffer3_26,
    eventBuffer3_27,
    eventBuffer3_28,
    eventBuffer3_29,
    eventBuffer3_30,
    eventBuffer3_31,
    eventBuffer3_32
};
#endif /* MAX_STEPS_TC */

/* #define MAX_STEPS_TC 1 */
#ifdef MAX_STEPS_TC

CsrSchedTid subEventTimerId4;

#define CM_FULL_BUFFER_LEN4_1    230
#define CM_FULL_BUFFER_LEN4_2    31
#define CM_FULL_BUFFER_LEN4_3    38

#define CM_TOTAL_EVENT_BUFFERS4 39

CsrUint8 subEventCurrentCounter4 = 0;

CsrUint8 eventBuffer4_1[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x17,0x01,0x01,0x00,0x01,0x13,0xD8,0x00,0x06,0x03,0x00,0xf3,0x01,0x00,0x04,0x03,0x00,0xf3,0x01,0x02,0x2b,0x09,0x00,0x5f,0x70,0x09,0x03,0x64,0x40,0x09,0x23,0x02,0x42,0x09,0x00,0x55,0x6f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x3d,0x09,0x00,0x87,0xbf,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x41,0x09,0x00,0x05,0x40,0xf5,0x03,0x00,0xf0,0xff,0x13,0x02,0x3c,0x09,0x00,0xf8,0xff,0xf5,0x03,0xee,0x0f,0xf6,0x23,0x02,0x27,0x09,0x00,0xa7,0xf0,0x03,0x03,0xaa,0x80,0x03,0x23,0x02,0x24,0x09,0x00,0xf4,0x2f,0xf5,0x03,0xeb,0x3f,0xf5,0x23,0x02,0x4a,0x09,0x00,0x9e,0x2f,0x0c,0x03,0xff,0x0f,0x00,0x13,0x02,0x0d,0x09,0x00,0x07,0xb0,0xf8,0x03,0xff,0xbf,0xf8,0x23,0x02,0x44,0x09,0x00,0x90,0x10,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x47,0x09,0x00,0xa1,0x50,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x13,0x09,0x00,0x01,0x90,0x07,0x03,0x06,0x90,0x07,
                                                   0x23,0x02,0x2c,0x09,0x00,0x52,0xbf,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x4c,0x09,0x00,0xe2,0xd0,0xfd,0x03,0xe1,0x10,0xfd,0x23,0x02,0x29,0x09,0x00,0x74,0x1f,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x3a,0x09,0x00,0x8d,0x70,0x04,0x03,0x91,0xf0,0x03,0x23,0x02,0x31,0x09,0x00,0x93,0xff,0x07,0x03,0x99,0x4f,0x08,0x23};

CsrUint8 eventBuffer4_2[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18 ,0x02,0x15,0x09,0x00,0x83,0xbf,0x00,0x03,0x83,0x2f,0x01,0x23,0x02,0x33,0x09,0x00,0x3b,0x70,0xf6,0x03,0x34,0x40,0xf6,0x23};

CsrUint8 eventBuffer4_3[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x39,0x03,0x00,0xf5,0x01,0x00,0x47,0x03,0x00,0xf7,0x01,0x02,0x15,0x09,0x00,0x8c,0x1f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x33,0x09,0x00,0xc3,0x7f,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x16,0x09,0x00,0x74,0x30,0x03,0x03,0x78,0xb0,0x02,0x23,0x02,0x04,0x09,0x00,0x24,0xa0,0x07,0x03,0x27,0xa0,0x07,0x23,0x02,0x35,0x09,0x00,0x42,0x20,0x09,0x03,0x4a,0xf0,0x08,0x23,0x02,0x46,0x09,0x00,0x7d,0xc0,0xf6,0x03,0x76,0x60,0xf6,0x23,0x02,0x1a,0x09,0x00,0xc5,0xef,0x07,0x03,0xcb,0x1f,0x08,0x23,0x02,0x3e,0x09,0x00,0x94,0x5f,0xf8,0x03,0x8d,0xbf,0xf8,0x23,0x02,0x0a,0x09,0x00,0x8d,0x3f,0xfe,0x03,0x8c,0x8f,0xfe,0x23,0x02,0x1b,0x09,0x00,0x3d,0x10,0x08,0x03,0x00,0x00,0x00,0x13,0x02,0x22,0x09,0x00,0xef,0x9f,0xf5,0x03,0xff,0xff,0xff,0x13,0x02,0x36,0x09,0x00,0x32,0x80,0xf6,0x03,0x2b,0x60,0xf6,
                                                   0x23,0x02,0x37,0x09,0x00,0x30,0x90,0xf6,0x03,0x28,0x60,0xf6,0x23,0x02,0x26,0x09,0x00,0x97,0xb0,0x05,0x03,0x9c,0x50,0x05,0x23,0x02,0x06,0x09,0x00,0x28,0x40,0x07,0x03,0x2e,0x30,0x07,0x23,0x02,0x08,0x09,0x00,0xc9,0x4f,0xf9,0x03,0xc6,0x6f,0xf9,0x23,0x02,0x07,0x09,0x00,0x3e,0x80,0x06,0x03,0x00,0x00,0x00,0x13};

CsrUint8 eventBuffer4_4[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18 , 0x02,0x3f,0x09,0x00,0x76,0x5f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x2a,0x09,0x00,0x67,0xe0,0xf6,0x03,0x00,0xf0,0xff,0x13};

CsrUint8 eventBuffer4_5[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x4a,0x03,0x00,0xf8,0x01,0x00,0x09,0x03,0x00,0xf2,0x01,0x02,0x3f,0x09,0x00,0xbd,0x7f,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x2a,0x09,0x00,0x75,0x60,0x08,0x03,0x7d,0x00,0x08,0x23,0x02,0x40,0x09,0x00,0x05,0x70,0x0a,0x03,0xff,0x0f,0x00,0x13,0x02,0x32,0x09,0x00,0x95,0x60,0x04,0x03,0x99,0xe0,0x03,0x23,0x02,0x0e,0x09,0x00,0x3d,0xd0,0xf9,0x03,0x00,0xf0,0xff,0x13,0x02,0x48,0x09,0x00,0xa2,0xa0,0x07,0x03,0xaa,0x00,0x07,0x23,0x02,0x2e,0x09,0x00,0x79,0x30,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x12,0x09,0x00,0xf4,0x8f,0xf8,0x03,0xff,0xff,0xff,0x13,0x02,0x45,0x09,0x00,0x5a,0x8f,0x05,0x03,0x5e,0x0f,0x06,0x23,0x02,0x30,0x09,0x00,0x27,0x40,0x0a,0x03,0xff,0x0f,0x00,0x13,0x02,0x0c,0x09,0x00,0x70,0xc0,0x01,0x03,0x72,0x70,0x01,0x23,0x02,0x2f,0x09,0x00,0x88,0x70,0x06,0x03,0x00,0x00,0x00,
                                                   0x13,0x02,0x1e,0x09,0x00,0x6a,0xbf,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x05,0x09,0x00,0xa5,0x7f,0x05,0x03,0xa9,0xbf,0x05,0x23,0x02,0x49,0x09,0x00,0xad,0x70,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x1f,0x09,0x00,0x81,0x60,0xfa,0x03,0x7b,0xe0,0xf9,0x23,0x02,0x02,0x09,0x00,0xdf,0xff,0xf7,0x03,0xda,0x0f,0xf8,0x23};

CsrUint8 eventBuffer4_6[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x0f,0x09,0x00,0xf6,0xcf,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x21,0x09,0x00,0xf5,0x3f,0x0a,0x03,0xff,0x0f,0x00,0x13};

CsrUint8 eventBuffer4_7[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x05,0x03,0x00,0xf3,0x01,0x00,0x30,0x03,0x00,0xf5,0x01,0x02,0x0f,0x09,0x00,0x67,0x20,0x03,0x03,0x6a,0xe0,0x02,0x23,0x02,0x21,0x09,0x00,0x96,0xf0,0x03,0x03,0x99,0x80,0x03,0x23,0x02,0x2d,0x09,0x00,0x53,0xff,0x01,0x03,0x53,0x5f,0x02,0x23,0x02,0x03,0x09,0x00,0x64,0xd0,0xfa,0x03,0x00,0x00,0x00,0x13,0x02,0x39,0x09,0x00,0x5c,0x00,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x28,0x09,0x00,0xb1,0xff,0x09,0x03,0xb8,0x2f,0x0a,0x23,0x02,0x1c,0x09,0x00,0x3f,0xc0,0xf7,0x03,0x39,0x90,0xf7,0x23,0x02,0x34,0x09,0x00,0xc5,0x9f,0xf6,0x03,0xba,0xdf,0xf6,0x23,0x02,0x11,0x09,0x00,0x10,0x40,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xa7,0xef,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x43,0x09,0x00,0xac,0xd0,0x02,0x03,0x00,0x00,0x00,0x13,0x02,0x25,0x09,0x00,0x55,0x9f,0xfd,0x03,0x54,0xff,0xfd,
                                                   0x23,0x02,0x10,0x09,0x00,0x90,0xcf,0xfd,0x03,0x8e,0x2f,0xfe,0x23,0x02,0x0b,0x09,0x00,0x73,0xc0,0xfe,0x03,0x72,0x70,0xfe,0x23,0x02,0x4b,0x09,0x00,0xb6,0x1f,0x0d,0x03,0xc2,0x6f,0x0d,0x23,0x02,0x3b,0x09,0x00,0x02,0x20,0xf6,0x03,0xfa,0x1f,0xf6,0x23,0x02,0x14,0x09,0x00,0xc4,0xaf,0x06,0x03,0xc9,0xef,0x06,0x23};

CsrUint8 eventBuffer4_8[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x1d,0x09,0x00,0xfb,0x5f,0x09,0x03,0x01,0x50,0x09,0x23,0x02,0x20,0x09,0x00,0xe5,0x1f,0xf6,0x03,0xde,0x2f,0xf6,0x23};

CsrUint8 eventBuffer4_9[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x23,0x03,0x00,0xf5,0x01,0x00,0x28,0x03,0x00,0xf6,0x01,0x02,0x1d,0x09,0x00,0x21,0xe0,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x20,0x09,0x00,0xa8,0x9f,0xf7,0x03,0xff,0xff,0xff,0x13,0x02,0x09,0x09,0x00,0xf3,0x5f,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x12,0x09,0x00,0x89,0xdf,0x00,0x03,0xff,0x0f,0x00,0x13,0x02,0x0e,0x09,0x00,0x6e,0x10,0x02,0x03,0x70,0xc0,0x01,0x23,0x02,0x21,0x09,0x00,0x81,0x7f,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x05,0x09,0x00,0x27,0x60,0x07,0x03,0x2c,0x50,0x07,0x23,0x02,0x4b,0x09,0x00,0x4c,0x2f,0x08,0x03,0x52,0x9f,0x08,0x23,0x02,0x15,0x09,0x00,0x4c,0x20,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x14,0x09,0x00,0xb1,0x2f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x3d,0x09,0x00,0x20,0xc0,0x09,0x03,0x2a,0xa0,0x09,0x23,0x02,0x44,0x09,0x00,0x67,0x3f,0x06,0x03,0x6c,0xbf,0x06,
                                                   0x23,0x02,0x3b,0x09,0x00,0x63,0x90,0x07,0x03,0x69,0x50,0x07,0x23,0x02,0x41,0x09,0x00,0xa9,0x70,0x00,0x03,0xaa,0xd0,0xff,0x23,0x02,0x08,0x09,0x00,0xfb,0x7f,0x07,0x03,0x00,0x70,0x07,0x23,0x02,0x43,0x09,0x00,0x40,0x60,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x36,0x09,0x00,0x90,0x20,0x04,0x03,0x93,0xc0,0x03,0x23};

CsrUint8 eventBuffer4_10[CM_FULL_BUFFER_LEN4_2] = {0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x03,0x09,0x00,0x2b,0x50,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x16,0x09,0x00,0x0e,0xd0,0x07,0x03,0xff,0x0f,0x00,0x13};

CsrUint8 eventBuffer4_11[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x08,0x03,0x00,0xf2,0x01,0x00,0x40,0x03,0x00,0xf5,0x01,0x02,0x03,0x09,0x00,0xe2,0xef,0x07,0x03,0xe9,0x0f,0x08,0x23,0x02,0x16,0x09,0x00,0xb7,0x7f,0xf9,0x03,0xff,0xff,0xff,0x13,0x02,0x0b,0x09,0x00,0x57,0xc0,0x04,0x03,0x00,0x00,0x00,0x13,0x02,0x28,0x09,0x00,0x11,0x10,0x0b,0x03,0x19,0x00,0x0b,0x23,0x02,0x29,0x09,0x00,0x56,0xc0,0x09,0x03,0x00,0x00,0x00,0x13,0x02,0x3c,0x09,0x00,0x7c,0xe0,0xf9,0x03,0x76,0x60,0xf9,0x23,0x02,0x45,0x09,0x00,0xff,0x5f,0xf4,0x03,0xff,0xff,0xff,0x13,0x02,0x31,0x09,0x00,0x8c,0x40,0xfa,0x03,0x00,0xf0,0xff,0x13,0x02,0x34,0x09,0x00,0x39,0x90,0xf6,0x03,0x33,0x70,0xf6,0x23,0x02,0x11,0x09,0x00,0x01,0xa0,0xf8,0x03,0xfb,0x9f,0xf8,0x23,0x02,0x3a,0x09,0x00,0x73,0xa0,0x06,0x03,0x79,0x40,0x06,0x23,0x02,0x3e,0x09,0x00,0x60,0x5f,0xfe,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x4c,0x09,0x00,0x3e,0x50,0xf2,0x03,0xff,0xff,0xff,0x13,0x02,0x2f,0x09,0x00,0x7a,0x5f,0xf9,0x03,0x73,0xdf,0xf9,0x23,0x02,0x02,0x09,0x00,0x2a,0xd0,0x07,0x03,0x30,0xc0,0x07,0x23,0x02,0x1c,0x09,0x00,0xc6,0x5f,0x08,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xad,0xbf,0xf6,0x03,0xff,0xff,0xff,0x13};

CsrUint8 eventBuffer4_12[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18,0x02,0x04,0x09,0x00,0x81,0x4f,0x00,0x03,0x81,0x9f,0x00,0x23,0x02,0x46,0x09,0x00,0xba,0xa0,0x02,0x03,0xbd,0xe0,0x01,0x23};


CsrUint8 eventBuffer4_13[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x3e,0x03,0x00,0xf5,0x01,0x00,0x3d,0x03,0x00,0xf5,0x01,0x02,0x04,0x09,0x00,0x6a,0xa0,0xfb,0x03,0x67,0x60,0xfb,0x23,0x02,0x46,0x09,0x00,0xee,0xff,0x0b,0x03,0x00,0x00,0x00,0x13,0x02,0x35,0x09,0x00,0x97,0xc0,0xfc,0x03,0x00,0xf0,0xff,0x13,0x02,0x1d,0x09,0x00,0x65,0x20,0xf9,0x03,0x00,0xf0,0xff,0x13,0x02,0x2e,0x09,0x00,0x5b,0x5f,0x03,0x03,0x5e,0xdf,0x03,0x23,0x02,0x2a,0x09,0x00,0x4d,0x5f,0x00,0x03,0x4d,0x8f,0x00,0x23,0x02,0x13,0x09,0x00,0xaf,0x9f,0x05,0x03,0xb2,0xcf,0x05,0x23,0x02,0x48,0x09,0x00,0x8d,0x8f,0x0a,0x03,0xff,0x0f,0x00,0x13,0x02,0x1f,0x09,0x00,0x86,0xf0,0x04,0x03,0x8a,0x90,0x04,0x23,0x02,0x42,0x09,0x00,0x71,0xc0,0xf7,0x03,0x00,0xf0,0xff,0x13,0x02,0x07,0x09,0x00,0x98,0xef,0x03,0x03,0x9b,0x3f,0x04,0x23,0x02,0x0a,0x09,0x00,0x23,0x00,0xf9,0x03,0x1f,0xe0,0xf8,
                                                    0x23,0x02,0x47,0x09,0x00,0xa3,0xe0,0x06,0x03,0xaa,0x30,0x06,0x23,0x02,0x27,0x09,0x00,0x5a,0x90,0x09,0x03,0x61,0x50,0x09,0x23,0x02,0x49,0x09,0x00,0x39,0x3f,0x04,0x03,0x3e,0x0f,0x05,0x23,0x02,0x32,0x09,0x00,0x4d,0xe0,0xf6,0x03,0x47,0xa0,0xf6,0x23,0x02,0x37,0x09,0x00,0xb9,0x2f,0xf7,0x03,0xb0,0x7f,0xf7,0x23};

CsrUint8 eventBuffer4_14[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x33,0x09,0x00,0xdd,0x0f,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x40,0x09,0x00,0x82,0x80,0xf9,0x03,0x7e,0x20,0xf9,0x23};


CsrUint8 eventBuffer4_15[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x2a,0x03,0x00,0xf6,0x01,0x00,0x16,0x03,0x00,0xf3,0x01,0x02,0x33,0x09,0x00,0x8d,0xe0,0xfa,0x03,0x88,0x70,0xfa,0x23,0x02,0x40,0x09,0x00,0x23,0x20,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x20,0x09,0x00,0x45,0xf0,0xf6,0x03,0x00,0xf0,0xff,0x13,0x02,0x1a,0x09,0x00,0x75,0x60,0xfb,0x03,0x72,0x00,0xfb,0x23,0x02,0x22,0x09,0x00,0xb5,0xbf,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x1b,0x09,0x00,0xda,0x9f,0x08,0x03,0xe2,0xbf,0x08,0x23,0x02,0x3f,0x09,0x00,0x9a,0x1f,0x08,0x03,0xa2,0x8f,0x08,0x23,0x02,0x30,0x09,0x00,0x75,0x80,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x4a,0x09,0x00,0x36,0xaf,0x04,0x03,0xff,0x0f,0x00,0x13,0x02,0x0c,0x09,0x00,0x9c,0xbf,0x03,0x03,0xff,0x0f,0x00,0x13,0x02,0x39,0x09,0x00,0xf4,0x3f,0xf6,0x03,0xe7,0x4f,0xf6,0x23,0x02,0x1e,0x09,0x00,0x72,0xaf,0x03,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x2b,0x09,0x00,0xb0,0xa0,0xfe,0x03,0xaf,0x20,0xfe,0x23,0x02,0x09,0x09,0x00,0x4b,0x50,0xfa,0x03,0x00,0xf0,0xff,0x13,0x02,0x06,0x09,0x00,0xd1,0x1f,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x24,0x09,0x00,0xa9,0xf0,0x01,0x03,0xaa,0x70,0x01,0x23,0x02,0x26,0x09,0x00,0xa1,0x90,0xfb,0x03,0x00,0xf0,0xff,0x13};

CsrUint8 eventBuffer4_16[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x25,0x09,0x00,0x9e,0x60,0xfb,0x03,0x9a,0xd0,0xfa,0x23,0x02,0x10,0x09,0x00,0x6b,0x30,0xfd,0x03,0x69,0xd0,0xfc,0x23};

CsrUint8 eventBuffer4_17[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x2b,0x03,0x00,0xf6,0x01,0x00,0x02,0x03,0x00,0xf3,0x01,0x02,0x25,0x09,0x00,0x2d,0x70,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x10,0x09,0x00,0x13,0x20,0x07,0x03,0x1a,0x10,0x07,0x23,0x02,0x2d,0x09,0x00,0xaf,0xbf,0x09,0x03,0xb6,0xef,0x09,0x23,0x02,0x0f,0x09,0x00,0xca,0x9f,0xf9,0x03,0xc5,0xbf,0xf9,0x23,0x02,0x2c,0x09,0x00,0xfb,0xff,0xf4,0x03,0xf2,0xff,0xf4,0x23,0x02,0x0d,0x09,0x00,0xb5,0x8f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x1a,0x09,0x00,0x01,0x50,0xf7,0x03,0x00,0xf0,0xff,0x13,0x02,0x23,0x09,0x00,0x68,0xbf,0x04,0x03,0x6c,0x2f,0x05,0x23,0x02,0x09,0x09,0x00,0xc8,0x8f,0xf9,0x03,0xff,0xff,0xff,0x13,0x02,0x4c,0x09,0x00,0x2d,0xbf,0xfa,0x03,0x27,0x9f,0xfb,0x23,0x02,0x30,0x09,0x00,0xbf,0xbf,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x31,0x09,0x00,0x19,0x40,0x0a,0x03,0x00,0x00,0x00,
                                                    0x13,0x02,0x4a,0x09,0x00,0x33,0x1f,0x04,0x03,0xff,0x0f,0x00,0x13,0x02,0x2f,0x09,0x00,0x37,0x10,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x34,0x09,0x00,0x9f,0xb0,0xfe,0x03,0x00,0x00,0x00,0x13,0x02,0x1e,0x09,0x00,0x3b,0xd0,0x08,0x03,0x00,0x00,0x00,0x13,0x02,0x45,0x09,0x00,0x89,0x10,0xf8,0x03,0x81,0x80,0xf7,0x23};

CsrUint8 eventBuffer4_18[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x14,0x09,0x00,0x9c,0x8f,0x04,0x03,0x9f,0xcf,0x04,0x23,0x02,0x2c,0x09,0x00,0x54,0x6f,0xfd,0x03,0xff,0xff,0xff,0x13};

CsrUint8 eventBuffer4_19[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x36,0x03,0x00,0xf5,0x01,0x00,0x1a,0x03,0x00,0xf4,0x01,0x02,0x14,0x09,0x00,0xc4,0x5f,0xf9,0x03,0xbe,0x8f,0xf9,0x23,0x02,0x2c,0x09,0x00,0x47,0x10,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x28,0x09,0x00,0x65,0xd0,0xf6,0x03,0x00,0xf0,0xff,0x13,0x02,0x15,0x09,0x00,0x78,0x10,0xfe,0x03,0x77,0xc0,0xfd,0x23,0x02,0x25,0x09,0x00,0xa2,0x00,0xfc,0x03,0x9e,0x70,0xfb,0x23,0x02,0x2e,0x09,0x00,0xea,0xbf,0x0a,0x03,0xf3,0xcf,0x0a,0x23,0x02,0x27,0x09,0x00,0xa0,0x50,0xfb,0x03,0x00,0xf0,0xff,0x13,0x02,0x03,0x09,0x00,0x3d,0xd0,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x10,0x09,0x00,0x71,0x90,0x01,0x03,0x72,0x50,0x01,0x23,0x02,0x0a,0x09,0x00,0x34,0x70,0xf9,0x03,0x00,0xf0,0xff,0x13,0x02,0x1b,0x09,0x00,0x19,0x40,0xf7,0x03,0x00,0xf0,0xff,0x13,0x02,0x3e,0x09,0x00,0x63,0x6f,0x02,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x3c,0x09,0x00,0x69,0x1f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x0d,0x09,0x00,0x8d,0x6f,0x00,0x03,0xff,0xff,0xff,0x13,0x02,0x39,0x09,0x00,0x7f,0x7f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x48,0x09,0x00,0x7f,0x3f,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x44,0x09,0x00,0x5a,0x20,0xf6,0x03,0x00,0xf0,0xff,0x13};

CsrUint8 eventBuffer4_20[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x05,0x09,0x00,0x10,0x40,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x49,0x09,0x00,0x44,0x9f,0x05,0x03,0x48,0x3f,0x06,0x23};

CsrUint8 eventBuffer4_21[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x21,0x03,0x00,0xf5,0x01,0x00,0x27,0x03,0x00,0xf6,0x01,0x02,0x05,0x09,0x00,0xea,0xaf,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x49,0x09,0x00,0xa4,0xe0,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x0f,0x09,0x00,0x34,0x80,0xf9,0x03,0x30,0x60,0xf9,0x23,0x02,0x12,0x09,0x00,0xcf,0x3f,0xf9,0x03,0xff,0xff,0xff,0x13,0x02,0x16,0x09,0x00,0x81,0x6f,0x00,0x03,0xff,0x0f,0x00,0x13,0x02,0x07,0x09,0x00,0x78,0xb0,0xff,0x03,0x78,0x60,0xff,0x23,0x02,0x1f,0x09,0x00,0x63,0x7f,0xff,0x03,0x62,0xbf,0xff,0x23,0x02,0x43,0x09,0x00,0x5c,0x4f,0x04,0x03,0x5f,0xef,0x04,0x23,0x02,0x26,0x09,0x00,0x72,0x7f,0xf9,0x03,0x6d,0xef,0xf9,0x23,0x02,0x04,0x09,0x00,0x80,0x4f,0x00,0x03,0x80,0x9f,0x00,0x23,0x02,0x3f,0x09,0x00,0x97,0x20,0xfc,0x03,0x00,0xf0,0xff,0x13,0x02,0x1c,0x09,0x00,0x86,0xef,0x04,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x41,0x09,0x00,0x8a,0x10,0x06,0x03,0x8e,0xd0,0x05,0x23,0x02,0x21,0x09,0x00,0x6c,0x8f,0xfb,0x03,0xff,0xff,0xff,0x13,0x02,0x20,0x09,0x00,0x7f,0x00,0x06,0x03,0x00,0x00,0x00,0x13,0x02,0x36,0x09,0x00,0x62,0x1f,0xff,0x03,0x61,0x9f,0xff,0x23,0x02,0x33,0x09,0x00,0x56,0x90,0x08,0x03,0x5a,0x70,0x08,0x23};

CsrUint8 eventBuffer4_22[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x47,0x09,0x00,0xc4,0x4f,0xf4,0x03,0xff,0xff,0xff,0x13,0x02,0x2a,0x09,0x00,0x76,0x0f,0x07,0x03,0xff,0x0f,0x00,0x13};

CsrUint8 eventBuffer4_23[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1b,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x49,0x03,0x00,0xf7,0x01,0x00,0x34,0x03,0x00,0xf5,0x01,0x02,0x47,0x09,0x00,0x4d,0x1f,0x05,0x03,0xff,0x0f,0x00,0x13,0x02,0x2a,0x09,0x00,0x6c,0xc0,0x08,0x03,0x00,0x00,0x00,0x13,0x02,0x2b,0x09,0x00,0x62,0xef,0xfa,0x03,0x60,0x3f,0xfb,0x23,0x02,0x3b,0x09,0x00,0xd5,0x7f,0x09,0x03,0xdc,0x9f,0x09,0x23,0x02,0x0e,0x09,0x00,0xc7,0x4f,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x46,0x09,0x00,0xb6,0xef,0xf4,0x03,0xad,0x2f,0xf5,0x23,0x02,0x22,0x09,0x00,0xb7,0x5f,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x35,0x09,0x00,0x48,0x20,0xf7,0x03,0x42,0xe0,0xf6,0x23,0x02,0x0b,0x09,0x00,0xeb,0x2f,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x3d,0x09,0x00,0x85,0x5f,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x3a,0x09,0x00,0x6d,0x5f,0x03,0x03,0x6f,0xef,0x03,0x23,0x02,0x4b,0x09,0x00,0x38,0x1f,0xfa,0x03,0x33,0xbf,0xfa,
                                                    0x23,0x02,0x0c,0x09,0x00,0x71,0x40,0x01,0x03,0x00,0xf0,0xff,0x13,0x02,0x32,0x09,0x00,0x6c,0xb0,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x42,0x09,0x00,0x60,0x00,0xf7,0x03,0x5b,0xc0,0xf6,0x23,0x02,0x37,0x09,0x00,0xe2,0xaf,0x09,0x03,0xec,0xbf,0x09,0x23,0x02,0x1d,0x09,0x00,0x87,0xe0,0x03,0x03,0x8a,0x80,0x03,0x23};

CsrUint8 eventBuffer4_24[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x02,0x09,0x00,0x4c,0x40,0xf9,0x03,0x48,0x00,0xf9,0x23,0x02,0x29,0x09,0x00,0x58,0x40,0xf6,0x03,0x00,0xf0,0xff,0x13};

CsrUint8 eventBuffer4_25[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x17,0x01,0x01,0x00,0x01,0x13,0xD8,0x00,0x06,0x03,0x00,0xf3,0x01,0x00,0x04,0x03,0x00,0xf3,0x01,0x02,0x2b,0x09,0x00,0x5f,0x70,0x09,0x03,0x64,0x40,0x09,0x23,0x02,0x42,0x09,0x00,0x55,0x6f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x3d,0x09,0x00,0x87,0xbf,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x41,0x09,0x00,0x05,0x40,0xf5,0x03,0x00,0xf0,0xff,0x13,0x02,0x3c,0x09,0x00,0xf8,0xff,0xf5,0x03,0xee,0x0f,0xf6,0x23,0x02,0x27,0x09,0x00,0xa7,0xf0,0x03,0x03,0xaa,0x80,0x03,0x23,0x02,0x24,0x09,0x00,0xf4,0x2f,0xf5,0x03,0xeb,0x3f,0xf5,0x23,0x02,0x4a,0x09,0x00,0x9e,0x2f,0x0c,0x03,0xff,0x0f,0x00,0x13,0x02,0x0d,0x09,0x00,0x07,0xb0,0xf8,0x03,0xff,0xbf,0xf8,0x23,0x02,0x44,0x09,0x00,0x90,0x10,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x47,0x09,0x00,0xa1,0x50,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x13,0x09,0x00,0x01,0x90,0x07,0x03,0x06,0x90,0x07,
                                                   0x23,0x02,0x2c,0x09,0x00,0x52,0xbf,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x4c,0x09,0x00,0xe2,0xd0,0xfd,0x03,0xe1,0x10,0xfd,0x23,0x02,0x29,0x09,0x00,0x74,0x1f,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x3a,0x09,0x00,0x8d,0x70,0x04,0x03,0x91,0xf0,0x03,0x23,0x02,0x31,0x09,0x00,0x93,0xff,0x07,0x03,0x99,0x4f,0x08,0x23};

CsrUint8 eventBuffer4_26[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18 ,0x02,0x15,0x09,0x00,0x83,0xbf,0x00,0x03,0x83,0x2f,0x01,0x23,0x02,0x33,0x09,0x00,0x3b,0x70,0xf6,0x03,0x34,0x40,0xf6,0x23};

CsrUint8 eventBuffer4_27[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x39,0x03,0x00,0xf5,0x01,0x00,0x47,0x03,0x00,0xf7,0x01,0x02,0x15,0x09,0x00,0x8c,0x1f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x33,0x09,0x00,0xc3,0x7f,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x16,0x09,0x00,0x74,0x30,0x03,0x03,0x78,0xb0,0x02,0x23,0x02,0x04,0x09,0x00,0x24,0xa0,0x07,0x03,0x27,0xa0,0x07,0x23,0x02,0x35,0x09,0x00,0x42,0x20,0x09,0x03,0x4a,0xf0,0x08,0x23,0x02,0x46,0x09,0x00,0x7d,0xc0,0xf6,0x03,0x76,0x60,0xf6,0x23,0x02,0x1a,0x09,0x00,0xc5,0xef,0x07,0x03,0xcb,0x1f,0x08,0x23,0x02,0x3e,0x09,0x00,0x94,0x5f,0xf8,0x03,0x8d,0xbf,0xf8,0x23,0x02,0x0a,0x09,0x00,0x8d,0x3f,0xfe,0x03,0x8c,0x8f,0xfe,0x23,0x02,0x1b,0x09,0x00,0x3d,0x10,0x08,0x03,0x00,0x00,0x00,0x13,0x02,0x22,0x09,0x00,0xef,0x9f,0xf5,0x03,0xff,0xff,0xff,0x13,0x02,0x36,0x09,0x00,0x32,0x80,0xf6,0x03,0x2b,0x60,0xf6,
                                                   0x23,0x02,0x37,0x09,0x00,0x30,0x90,0xf6,0x03,0x28,0x60,0xf6,0x23,0x02,0x26,0x09,0x00,0x97,0xb0,0x05,0x03,0x9c,0x50,0x05,0x23,0x02,0x06,0x09,0x00,0x28,0x40,0x07,0x03,0x2e,0x30,0x07,0x23,0x02,0x08,0x09,0x00,0xc9,0x4f,0xf9,0x03,0xc6,0x6f,0xf9,0x23,0x02,0x07,0x09,0x00,0x3e,0x80,0x06,0x03,0x00,0x00,0x00,0x13};

CsrUint8 eventBuffer4_28[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18 , 0x02,0x3f,0x09,0x00,0x76,0x5f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x2a,0x09,0x00,0x67,0xe0,0xf6,0x03,0x00,0xf0,0xff,0x13};

CsrUint8 eventBuffer4_29[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x1a,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x4a,0x03,0x00,0xf8,0x01,0x00,0x09,0x03,0x00,0xf2,0x01,0x02,0x3f,0x09,0x00,0xbd,0x7f,0x09,0x03,0xff,0x0f,0x00,0x13,0x02,0x2a,0x09,0x00,0x75,0x60,0x08,0x03,0x7d,0x00,0x08,0x23,0x02,0x40,0x09,0x00,0x05,0x70,0x0a,0x03,0xff,0x0f,0x00,0x13,0x02,0x32,0x09,0x00,0x95,0x60,0x04,0x03,0x99,0xe0,0x03,0x23,0x02,0x0e,0x09,0x00,0x3d,0xd0,0xf9,0x03,0x00,0xf0,0xff,0x13,0x02,0x48,0x09,0x00,0xa2,0xa0,0x07,0x03,0xaa,0x00,0x07,0x23,0x02,0x2e,0x09,0x00,0x79,0x30,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x12,0x09,0x00,0xf4,0x8f,0xf8,0x03,0xff,0xff,0xff,0x13,0x02,0x45,0x09,0x00,0x5a,0x8f,0x05,0x03,0x5e,0x0f,0x06,0x23,0x02,0x30,0x09,0x00,0x27,0x40,0x0a,0x03,0xff,0x0f,0x00,0x13,0x02,0x0c,0x09,0x00,0x70,0xc0,0x01,0x03,0x72,0x70,0x01,0x23,0x02,0x2f,0x09,0x00,0x88,0x70,0x06,0x03,0x00,0x00,0x00,
                                                   0x13,0x02,0x1e,0x09,0x00,0x6a,0xbf,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x05,0x09,0x00,0xa5,0x7f,0x05,0x03,0xa9,0xbf,0x05,0x23,0x02,0x49,0x09,0x00,0xad,0x70,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x1f,0x09,0x00,0x81,0x60,0xfa,0x03,0x7b,0xe0,0xf9,0x23,0x02,0x02,0x09,0x00,0xdf,0xff,0xf7,0x03,0xda,0x0f,0xf8,0x23};

CsrUint8 eventBuffer4_30[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x0f,0x09,0x00,0xf6,0xcf,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x21,0x09,0x00,0xf5,0x3f,0x0a,0x03,0xff,0x0f,0x00,0x13};

CsrUint8 eventBuffer4_31[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x05,0x03,0x00,0xf3,0x01,0x00,0x30,0x03,0x00,0xf5,0x01,0x02,0x0f,0x09,0x00,0x67,0x20,0x03,0x03,0x6a,0xe0,0x02,0x23,0x02,0x21,0x09,0x00,0x96,0xf0,0x03,0x03,0x99,0x80,0x03,0x23,0x02,0x2d,0x09,0x00,0x53,0xff,0x01,0x03,0x53,0x5f,0x02,0x23,0x02,0x03,0x09,0x00,0x64,0xd0,0xfa,0x03,0x00,0x00,0x00,0x13,0x02,0x39,0x09,0x00,0x5c,0x00,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x28,0x09,0x00,0xb1,0xff,0x09,0x03,0xb8,0x2f,0x0a,0x23,0x02,0x1c,0x09,0x00,0x3f,0xc0,0xf7,0x03,0x39,0x90,0xf7,0x23,0x02,0x34,0x09,0x00,0xc5,0x9f,0xf6,0x03,0xba,0xdf,0xf6,0x23,0x02,0x11,0x09,0x00,0x10,0x40,0x07,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xa7,0xef,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x43,0x09,0x00,0xac,0xd0,0x02,0x03,0x00,0x00,0x00,0x13,0x02,0x25,0x09,0x00,0x55,0x9f,0xfd,0x03,0x54,0xff,0xfd,
                                                   0x23,0x02,0x10,0x09,0x00,0x90,0xcf,0xfd,0x03,0x8e,0x2f,0xfe,0x23,0x02,0x0b,0x09,0x00,0x73,0xc0,0xfe,0x03,0x72,0x70,0xfe,0x23,0x02,0x4b,0x09,0x00,0xb6,0x1f,0x0d,0x03,0xc2,0x6f,0x0d,0x23,0x02,0x3b,0x09,0x00,0x02,0x20,0xf6,0x03,0xfa,0x1f,0xf6,0x23,0x02,0x14,0x09,0x00,0xc4,0xaf,0x06,0x03,0xc9,0xef,0x06,0x23};

CsrUint8 eventBuffer4_32[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x1d,0x09,0x00,0xfb,0x5f,0x09,0x03,0x01,0x50,0x09,0x23,0x02,0x20,0x09,0x00,0xe5,0x1f,0xf6,0x03,0xde,0x2f,0xf6,0x23};

CsrUint8 eventBuffer4_33[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x23,0x03,0x00,0xf5,0x01,0x00,0x28,0x03,0x00,0xf6,0x01,0x02,0x1d,0x09,0x00,0x21,0xe0,0xf6,0x03,0xff,0xff,0xff,0x13,0x02,0x20,0x09,0x00,0xa8,0x9f,0xf7,0x03,0xff,0xff,0xff,0x13,0x02,0x09,0x09,0x00,0xf3,0x5f,0x07,0x03,0x00,0x00,0x00,0x13,0x02,0x12,0x09,0x00,0x89,0xdf,0x00,0x03,0xff,0x0f,0x00,0x13,0x02,0x0e,0x09,0x00,0x6e,0x10,0x02,0x03,0x70,0xc0,0x01,0x23,0x02,0x21,0x09,0x00,0x81,0x7f,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x05,0x09,0x00,0x27,0x60,0x07,0x03,0x2c,0x50,0x07,0x23,0x02,0x4b,0x09,0x00,0x4c,0x2f,0x08,0x03,0x52,0x9f,0x08,0x23,0x02,0x15,0x09,0x00,0x4c,0x20,0x06,0x03,0xff,0x0f,0x00,0x13,0x02,0x14,0x09,0x00,0xb1,0x2f,0xfa,0x03,0xff,0xff,0xff,0x13,0x02,0x3d,0x09,0x00,0x20,0xc0,0x09,0x03,0x2a,0xa0,0x09,0x23,0x02,0x44,0x09,0x00,0x67,0x3f,0x06,0x03,0x6c,0xbf,0x06,
                                                   0x23,0x02,0x3b,0x09,0x00,0x63,0x90,0x07,0x03,0x69,0x50,0x07,0x23,0x02,0x41,0x09,0x00,0xa9,0x70,0x00,0x03,0xaa,0xd0,0xff,0x23,0x02,0x08,0x09,0x00,0xfb,0x7f,0x07,0x03,0x00,0x70,0x07,0x23,0x02,0x43,0x09,0x00,0x40,0x60,0x0a,0x03,0x00,0x00,0x00,0x13,0x02,0x36,0x09,0x00,0x90,0x20,0x04,0x03,0x93,0xc0,0x03,0x23};

CsrUint8 eventBuffer4_34[CM_FULL_BUFFER_LEN4_2] = {0x00,0x01,0x00,0x00,0x01,0x02,0x18, 0x02,0x03,0x09,0x00,0x2b,0x50,0xf8,0x03,0x00,0xf0,0xff,0x13,0x02,0x16,0x09,0x00,0x0e,0xd0,0x07,0x03,0xff,0x0f,0x00,0x13};

CsrUint8 eventBuffer4_35[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x08,0x03,0x00,0xf2,0x01,0x00,0x40,0x03,0x00,0xf5,0x01,0x02,0x03,0x09,0x00,0xe2,0xef,0x07,0x03,0xe9,0x0f,0x08,0x23,0x02,0x16,0x09,0x00,0xb7,0x7f,0xf9,0x03,0xff,0xff,0xff,0x13,0x02,0x0b,0x09,0x00,0x57,0xc0,0x04,0x03,0x00,0x00,0x00,0x13,0x02,0x28,0x09,0x00,0x11,0x10,0x0b,0x03,0x19,0x00,0x0b,0x23,0x02,0x29,0x09,0x00,0x56,0xc0,0x09,0x03,0x00,0x00,0x00,0x13,0x02,0x3c,0x09,0x00,0x7c,0xe0,0xf9,0x03,0x76,0x60,0xf9,0x23,0x02,0x45,0x09,0x00,0xff,0x5f,0xf4,0x03,0xff,0xff,0xff,0x13,0x02,0x31,0x09,0x00,0x8c,0x40,0xfa,0x03,0x00,0xf0,0xff,0x13,0x02,0x34,0x09,0x00,0x39,0x90,0xf6,0x03,0x33,0x70,0xf6,0x23,0x02,0x11,0x09,0x00,0x01,0xa0,0xf8,0x03,0xfb,0x9f,0xf8,0x23,0x02,0x3a,0x09,0x00,0x73,0xa0,0x06,0x03,0x79,0x40,0x06,0x23,0x02,0x3e,0x09,0x00,0x60,0x5f,0xfe,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x4c,0x09,0x00,0x3e,0x50,0xf2,0x03,0xff,0xff,0xff,0x13,0x02,0x2f,0x09,0x00,0x7a,0x5f,0xf9,0x03,0x73,0xdf,0xf9,0x23,0x02,0x02,0x09,0x00,0x2a,0xd0,0x07,0x03,0x30,0xc0,0x07,0x23,0x02,0x1c,0x09,0x00,0xc6,0x5f,0x08,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xad,0xbf,0xf6,0x03,0xff,0xff,0xff,0x13};

CsrUint8 eventBuffer4_36[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18,0x02,0x04,0x09,0x00,0x81,0x4f,0x00,0x03,0x81,0x9f,0x00,0x23,0x02,0x46,0x09,0x00,0xba,0xa0,0x02,0x03,0xbd,0xe0,0x01,0x23};

CsrUint8 eventBuffer4_37[CM_FULL_BUFFER_LEN4_1] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x16,0x01,0x01,0x00,0x01,0x13,0xD8, 0x00,0x08,0x03,0x00,0xf2,0x01,0x00,0x40,0x03,0x00,0xf5,0x01,0x02,0x03,0x09,0x00,0xe2,0xef,0x07,0x03,0xe9,0x0f,0x08,0x23,0x02,0x16,0x09,0x00,0xb7,0x7f,0xf9,0x03,0xff,0xff,0xff,0x13,0x02,0x0b,0x09,0x00,0x57,0xc0,0x04,0x03,0x00,0x00,0x00,0x13,0x02,0x28,0x09,0x00,0x11,0x10,0x0b,0x03,0x19,0x00,0x0b,0x23,0x02,0x29,0x09,0x00,0x56,0xc0,0x09,0x03,0x00,0x00,0x00,0x13,0x02,0x3c,0x09,0x00,0x7c,0xe0,0xf9,0x03,0x76,0x60,0xf9,0x23,0x02,0x45,0x09,0x00,0xff,0x5f,0xf4,0x03,0xff,0xff,0xff,0x13,0x02,0x31,0x09,0x00,0x8c,0x40,0xfa,0x03,0x00,0xf0,0xff,0x13,0x02,0x34,0x09,0x00,0x39,0x90,0xf6,0x03,0x33,0x70,0xf6,0x23,0x02,0x11,0x09,0x00,0x01,0xa0,0xf8,0x03,0xfb,0x9f,0xf8,0x23,0x02,0x3a,0x09,0x00,0x73,0xa0,0x06,0x03,0x79,0x40,0x06,0x23,0x02,0x3e,0x09,0x00,0x60,0x5f,0xfe,0x03,0xff,0x0f,0x00,
                                                    0x13,0x02,0x4c,0x09,0x00,0x3e,0x50,0xf2,0x03,0xff,0xff,0xff,0x13,0x02,0x2f,0x09,0x00,0x7a,0x5f,0xf9,0x03,0x73,0xdf,0xf9,0x23,0x02,0x02,0x09,0x00,0x2a,0xd0,0x07,0x03,0x30,0xc0,0x07,0x23,0x02,0x1c,0x09,0x00,0xc6,0x5f,0x08,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xad,0xbf,0xf6,0x03,0xff,0xff,0xff,0x13};

CsrUint8 eventBuffer4_38[CM_FULL_BUFFER_LEN4_2] = { 0x00,0x01,0x00,0x00,0x01,0x02,0x18,0x02,0x04,0x09,0x00,0x81,0x4f,0x00,0x03,0x81,0x9f,0x00,0x23,0x02,0x46,0x09,0x00,0xba,0xa0,0x02,0x03,0xbd,0xe0,0x01,0x23};

CsrUint8 eventBuffer4_39[CM_FULL_BUFFER_LEN4_3] = { 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x19,0x00,0x00,0x00,0x01,0x03,0x18, 0x00,0x2d,0x03,0x00,0xf6,0x01,0x00,0x1e,0x03,0x00,0xf4,0x01,0x02,0x02,0x09,0x00,0xe2,0xff,0xf7,0x03,0xde,0xff,0xf7,0x23};

CsrUint8 *eventBuffer4_x[] = 
{
    eventBuffer4_1,
    eventBuffer4_2,
    eventBuffer4_3,
    eventBuffer4_4,
    eventBuffer4_5,
    eventBuffer4_6,
    eventBuffer4_7,
    eventBuffer4_8,
    eventBuffer4_9,
    eventBuffer4_10,
    eventBuffer4_11,
    eventBuffer4_12,
    eventBuffer4_13,
    eventBuffer4_14,
    eventBuffer4_15,
    eventBuffer4_16,
    eventBuffer4_17,
    eventBuffer4_18,
    eventBuffer4_19,
    eventBuffer4_20,
    eventBuffer4_21,
    eventBuffer4_22,
    eventBuffer4_23,
    eventBuffer4_24,
    eventBuffer4_25,
    eventBuffer4_26,
    eventBuffer4_27,
    eventBuffer4_28,
    eventBuffer4_29,
    eventBuffer4_30,
    eventBuffer4_31,
    eventBuffer4_32,
    eventBuffer4_33,
    eventBuffer4_34,
    eventBuffer4_35,
    eventBuffer4_36,
    eventBuffer4_37,
    eventBuffer4_38,
    eventBuffer4_39
};
#endif /* MAX_STEPS_TC */

/* Mode2_Mode 1 */
CsrSchedTid subEventTimerId6;

#define CM_FULL_BUFFER_LEN6_1    236
#define CM_FULL_BUFFER_LEN6_2    235
#define CM_FULL_BUFFER_LEN6_3    232
#define CM_FULL_BUFFER_LEN6_4    238
#define CM_FULL_BUFFER_LEN6_5    191

#define CM_TOTAL_EVENT_BUFFERS6 5

CsrUint8 subEventCurrentCounter6 = 0;
/*
                 <-- 13 octets fixed header ---------->
04 3e ee 31 0100 01 3a 00 00 00 00 c0 ff 01 01 00 01 15 001e0300da0000030300d700003b0300d900022c0900f13ffc03f42ffc23022409003af0fd0300f0ff1302340900fa7ffc03fb7ffc2302350900cbbffe03cc9ffe230135060000d9e6fc0002290900d7dffc03ffffff13022109002ac0fc0300e0ff1302420900bd3f0003ff0f001302310900ca9ffe03ca7ffe230131060000d9dbfc00021309002fe0fe033000ff23022b0900df5f0303ff0f0013012b060000daf4fc0002220900d31f0303ff1f001302080900d17f0003d16f0023023e09000cc0030300100013021e09002fb0020300100013011e060000daf1fc00

                  <-6 octets fix hr>
04 3e ea 32 01 00 01 01 01 00 01 19 

*/
CsrUint8 eventBuffer6_1[CM_FULL_BUFFER_LEN6_1] = { 0x01,0x3a,0x00,0x00,0x00,0x00,0xc0,0xff,0x01,0x01,0x00,0x01,0x15, 0xDE, 0x00,0x1e,0x03,0x00,0xda,0x00,0x00,0x03,0x03,0x00,0xd7,0x00,0x00,0x3b,0x03,0x00,0xd9,0x00,0x02,0x2c,0x09,0x00,0xf1,0x3f,0xfc,0x03,0xf4,0x2f,0xfc,0x23,0x02,0x24,0x09,0x00,0x3a,0xf0,0xfd,0x03,0x00,0xf0,0xff,0x13,0x02,0x34,0x09,0x00,0xfa,0x7f,0xfc,0x03,0xfb,0x7f,0xfc,0x23,0x02,0x35,0x09,0x00,0xcb,0xbf,0xfe,0x03,0xcc,0x9f,0xfe,0x23,0x01,0x35,0x06,0x00,0x00,0xd9,0xe6,0xfc,0x00,0x02,0x29,0x09,0x00,0xd7,0xdf,0xfc,0x03,0xff,0xff,0xff,0x13,0x02,0x21,0x09,0x00,0x2a,0xc0,0xfc,0x03,0x00,0xe0,0xff,0x13,0x02,0x42,0x09,0x00,0xbd,0x3f,0x00,0x03,0xff,0x0f,0x00,0x13,0x02,0x31,0x09,0x00,0xca,0x9f,0xfe,0x03,0xca,0x7f,0xfe,0x23,0x01,0x31,0x06,0x00,0x00,0xd9,0xdb,0xfc,0x00,0x02,0x13,0x09,0x00,0x2f,0xe0,0xfe,0x03,0x30,0x00,0xff,0x23,0x02,0x2b,0x09,0x00,0xdf,0x5f,
                                                   0x03,0x03,0xff,0x0f,0x00,0x13,0x01,0x2b,0x06,0x00,0x00,0xda,0xf4,0xfc,0x00,0x02,0x22,0x09,0x00,0xd3,0x1f,0x03,0x03,0xff,0x1f,0x00,0x13,0x02,0x08,0x09,0x00,0xd1,0x7f,0x00,0x03,0xd1,0x6f,0x00,0x23,0x02,0x3e,0x09,0x00,0x0c,0xc0,0x03,0x03,0x00,0x10,0x00,0x13,0x02,0x1e,0x09,0x00,0x2f,0xb0,0x02,0x03,0x00,0x10,0x00,0x13,0x01,0x1e,0x06,0x00,0x00,0xda,0xf1,0xfc,0x00};

CsrUint8 eventBuffer6_2[CM_FULL_BUFFER_LEN6_2] = { 0x01,0x01,0x01,0x00,0x01,0x14, 0xE4, 0x02,0x0b,0x09,0x00,0x1d,0x40,0x02,0x03,0x00,0x00,0x00,0x13,0x02,0x39,0x09,0x00,0xcb,0x9f,0xfe,0x03,0xff,0xff,0xff,0x13,0x02,0x2d,0x09,0x00,0xd9,0xff,0xfc,0x03,0xff,0xff,0xff,0x13,0x02,0x25,0x09,0x00,0x20,0x60,0xfc,0x03,0xff,0xef,0xff,0x13,0x01,0x25,0x06,0x00,0x00,0xdb,0x01,0xfd,0x00,0x02,0x0d,0x09,0x00,0x29,0x60,0x01,0x03,0x29,0x70,0x01,0x23,0x02,0x30,0x09,0x00,0xd2,0xaf,0xfd,0x03,0xd3,0x8f,0xfd,0x23,0x02,0x33,0x09,0x00,0xf0,0x8f,0xfc,0x03,0xf2,0x8f,0xfc,0x23,0x02,0x10,0x09,0x00,0x2f,0xf0,0x00,0x03,0x2e,0x10,0x01,0x23,0x01,0x10,0x06,0x00,0x00,0xd8,0x13,0xfd,0x00,0x02,0x15,0x09,0x00,0x2a,0x10,0xfe,0x03,0x2b,0x30,0xfe,0x23,0x02,0x1b,0x09,0x00,0xf5,0xbf,0x03,0x03,0xff,0x0f,0x00,0x13,0x02,0x3c,0x09,0x00,0xc4,0x7f,0xff,0x03,0xfe,0x0f,0x00,0x13,0x01,0x3c,0x06,0x00,0x00,0xd9,0x0a,
                                                   0xfd,0x00,0x02,0x3f,0x09,0x00,0x3a,0x90,0xfe,0x03,0x3b,0xa0,0xfe,0x23,0x02,0x20,0x09,0x00,0x30,0xc0,0x02,0x03,0x2e,0xe0,0x02,0x23,0x02,0x37,0x09,0x00,0xf7,0x8f,0xfc,0x03,0xfa,0x7f,0xfc,0x23,0x01,0x37,0x06,0x00,0x00,0xd9,0xfa,0xfc,0x00,0x02,0x45,0x09,0x00,0xbb,0x1f,0x01,0x03,0xba,0xef,0x00,0x23,0x02,0x43,0x09,0x00,0x3a,0x20,0x02,0x03,0x38,0x50,0x02,0x23};

CsrUint8 eventBuffer6_3[CM_FULL_BUFFER_LEN6_3] = { 0x01,0x01,0x01,0x00,0x01,0x14, 0xE1, 0x02,0x28,0x09,0x00,0x01,0x10,0x04,0x03,0x00,0x10,0x00,0x13,0x01,0x28,0x06,0x00,0x00,0xda,0x00,0xfd,0x00,0x02,0x40,0x09,0x00,0xbf,0xdf,0xff,0x03,0xc0,0xcf,0xff,0x23,0x02,0x47,0x09,0x00,0xff,0x9f,0x04,0x03,0x00,0x10,0x00,0x13,0x01,0x47,0x06,0x00,0x00,0xdb,0xe6,0xfc,0x00,0x02,0x36,0x09,0x00,0x06,0x80,0x03,0x03,0x00,0x00,0x00,0x13,0x02,0x09,0x09,0x00,0x19,0x70,0xfd,0x03,0x00,0xf0,0xff,0x13,0x02,0x0e,0x09,0x00,0xf2,0xdf,0x02,0x03,0xff,0x0f,0x00,0x13,0x02,0x02,0x09,0x00,0xec,0xef,0x02,0x03,0xff,0x0f,0x00,0x13,0x02,0x23,0x09,0x00,0xe1,0x4f,0xfc,0x03,0xe4,0x3f,0xfc,0x23,0x01,0x23,0x06,0x00,0x00,0xdb,0x02,0xfd,0x00,0x02,0x12,0x09,0x00,0xe4,0x5f,0xfd,0x03,0xe5,0x5f,0xfd,0x23,0x02,0x14,0x09,0x00,0x28,0xf0,0xfd,0x03,0x29,0x10,0xfe,0x23,0x02,0x04,0x09,0x00,0xfe,0x0f,0x03,0x03,0xff,0x0f,
                                                   0x00,0x13,0x02,0x48,0x09,0x00,0x42,0xd0,0xfd,0x03,0x01,0xe0,0xff,0x13,0x02,0x49,0x09,0x00,0x0b,0x40,0xfb,0x03,0x00,0xe0,0xff,0x13,0x01,0x49,0x06,0x00,0x00,0xdc,0x05,0xfd,0x00,0x02,0x3d,0x09,0x00,0x2b,0xa0,0x02,0x03,0x29,0xc0,0x02,0x23,0x02,0x0c,0x09,0x00,0x00,0x00,0xfd,0x03,0x02,0x00,0xfd,0x23,0x01,0x0c,0x06,0x00,0x00,0xd8,0x0c,0xfd,0x00};

CsrUint8 eventBuffer6_4[CM_FULL_BUFFER_LEN6_4] = { 0x01,0x01,0x00,0x00,0x01,0x14, 0xE7,0x02,0x4a,0x09,0x00,0x3e,0x10,0xfd,0x03,0x40,0x30,0xfd,0x23,0x02,0x46,0x09,0x00,0x16,0xb0,0xfb,0x03,0x00,0xe0,0xff,0x13,0x02,0x03,0x09,0x00,0x30,0x90,0xff,0x03,0x30,0xa0,0xff,0x23,0x02,0x1c,0x09,0x00,0xc7,0x7f,0xfe,0x03,0xc7,0x7f,0xfe,0x23,0x02,0x3b,0x09,0x00,0xe1,0x2f,0x03,0x03,0xff,0x1f,0x00,0x13,0x01,0x3b,0x06,0x00,0x00,0xda,0x08,0xfd,0x00,0x02,0x27,0x09,0x00,0xce,0x4f,0xfd,0x03,0xfe,0xff,0xff,0x13,0x02,0x07,0x09,0x00,0x28,0x70,0xfe,0x03,0x27,0x60,0xfe,0x23,0x02,0x4c,0x09,0x00,0x32,0xe0,0x03,0x03,0x2e,0x10,0x04,0x23,0x02,0x0a,0x09,0x00,0xd4,0x2f,0x01,0x03,0xff,0x0f,0x00,0x13,0x02,0x11,0x09,0x00,0xfc,0xef,0xfc,0x03,0xff,0xff,0xff,0x13,0x01,0x11,0x06,0x00,0x00,0xd8,0x19,0xfd,0x00,0x02,0x05,0x09,0x00,0x20,0x20,0x02,0x03,0x00,0x00,0x00,0x13,0x02,0x4b,0x09,0x00,0x3c,0xc0,0xfc,
                                                   0x03,0x3e,0xe0,0xfc,0x23,0x02,0x44,0x09,0x00,0xbe,0x7f,0x01,0x03,0xbd,0x4f,0x01,0x23,0x02,0x16,0x09,0x00,0xce,0x3f,0x01,0x03,0xff,0x0f,0x00,0x13,0x02,0x32,0x09,0x00,0x22,0x10,0xfd,0x03,0x24,0x20,0xfd,0x23,0x01,0x32,0x06,0x00,0x00,0xd9,0x20,0xfd,0x00,0x02,0x1d,0x09,0x00,0xd0,0x6f,0xfd,0x03,0xd2,0x5f,0xfd,0x23,0x02,0x2f,0x09,0x00,0xcd,0x1f,0x02,0x03,0xcd,0xff,0x01,0x23};

CsrUint8 eventBuffer6_5[CM_FULL_BUFFER_LEN6_5] = { 0x01,0x3a,0x00,0x00,0x00,0x00,0xc0,0xfe,0x00,0x00,0x00,0x01,0x11, 0xB1, 0x00,0x2e,0x03,0x00,0xda,0x00,0x00,0x14,0x03,0x00,0xd8,0x00,0x00,0x3e,0x03,0x00,0xda,0x00,0x02,0x1d,0x09,0x00,0xeb,0x4f,0xfc,0x03,0xee,0x3f,0xfc,0x23,0x02,0x2f,0x09,0x00,0xc3,0x4f,0x00,0x03,0xc3,0x1f,0x00,0x23,0x01,0x2f,0x06,0x00,0x00,0xd9,0x83,0xfd,0x00,0x02,0x1a,0x09,0x00,0xd8,0x4f,0xfd,0x03,0xff,0xff,0xff,0x13,0x02,0x2a,0x09,0x00,0x3d,0xc0,0xfe,0x03,0x00,0xf0,0xff,0x13,0x02,0x1f,0x09,0x00,0xfd,0x0f,0x04,0x03,0xfb,0x0f,0x04,0x23,0x02,0x3a,0x09,0x00,0xf4,0x8f,0x03,0x03,0xf2,0x8f,0x03,0x23,0x01,0x3a,0x06,0x00,0x00,0xd9,0x95,0xfd,0x00,0x02,0x41,0x09,0x00,0xc1,0x3f,0x01,0x03,0xff,0x0f,0x00,0x13,0x02,0x06,0x09,0x00,0x07,0xe0,0x02,0x03,0x00,0x00,0x00,0x13,0x01,0x06,0x06,0x00,0x00,0xd8,0x87,0xfd,0x00,0x02,0x26,0x09,0x00,0xcb,0x7f,0xfd,0x03,0xfe,
                                                   0xff,0xff,0x13,0x02,0x2e,0x09,0x00,0x01,0xd0,0x03,0x03,0xff,0xdf,0x03,0x23,0x02,0x0f,0x09,0x00,0xe9,0x4f,0xfd,0x03,0xeb,0x3f,0xfd,0x23};

CsrUint8 *eventBuffer6_x[] = 
{
    eventBuffer6_1,
    eventBuffer6_2,
    eventBuffer6_3,
    eventBuffer6_4,
    eventBuffer6_5
};

/* Filter test */
CsrSchedTid subEventTimerId7;

#define CM_FULL_BUFFER_LEN7_1    242
#define CM_FULL_BUFFER_LEN7_2    177
#define CM_FULL_BUFFER_LEN7_3    230
#define CM_FULL_BUFFER_LEN7_4    103
#define CM_FULL_BUFFER_LEN7_5    212
#define CM_FULL_BUFFER_LEN7_6    101

#define CM_TOTAL_EVENT_BUFFERS7 6

CsrUint8 subEventCurrentCounter7 = 0;

CsrUint8 eventBuffer7_1[CM_FULL_BUFFER_LEN7_1] = { 0x00,0x84,0x00,0x00,0x00,0x20,0xFF,0x7F,0x01,0x01,0x00,0x04,0x0F, 0xE4, 0x00,0x26,0x05,0x02,0xA6,0x01,0x22,0xFF,0x00,0x2E,0x05,0x00,0xE6,0x01,0x20,0xFF,0x00,0x30,0x05,0x00,0xE5,0x01,0x1E,0xFF,0x01,0x02,0x0E,0x00,0xFF,0xE6,0x3C,0xFA,0x01,0x4D,0x1F,0x4A,0x00,0xC8,0xBC,0x38,0x00,0x01,0x28,0x0E,0x00,0xFF,0xE4,0xCE,0xF9,0x01,0x04,0x23,0xC9,0x00,0x38,0x84,0xE4,0x00,0x01,0x37,0x0E,0x00,0xFF,0xE5,0x86,0xF9,0x01,0xDF,0x8A,0xDE,0x00,0x51,0xBE,0xA9,0x00,0x01,0x32,0x0E,0x00,0xFF,0xE5,0x49,0xF9,0x01,0x78,0xDC,0xB8,0x00,0xC6,0x31,0xAB,0x00,0x01,0x38,0x0E,0x00,0xFF,0xE3,0xB7,0xF9,0x01,0x1D,0x64,0xB9,0x00,0x2E,0xB5,0xD4,0x00,0x01,0x46,0x0E,0x00,0xFF,0xE5,0x1F,0xFA,0x01,0x64,0xFB,0x44,0x00,0x3C,0xFA,0x1D,0x00,0x01,0x40,0x0E,0x00,0xFF,0xE6,0xBB,0xF9,0x01,0xB9,0xE5,0xEA,0x00,0x08,0x56,0x1F,0x00,0x01,0x2C,
                                                   0x0E,0x00,0xFF,0xE6,0x38,0xFA,0x01,0xEF,0xA4,0xEE,0x00,0xEB,0x54,0x23,0x00,0x01,0x2B,0x0E,0x00,0xFF,0xE5,0x7E,0xF9,0x01,0x8F,0xFF,0x54,0x00,0x2B,0xCC,0x36,0x00,0x01,0x2F,0x0E,0x00,0xFF,0xE5,0xD6,0xF9,0x01,0xB4,0xF0,0x52,0x00,0x2D,0xCC,0x3A,0x00,0x01,0x06,0x0E,0x00,0xFF,0xE4,0x11,0xFA,0x01,0x79,0xB2,0x3B,0x00,0x16,0xA1,0x48,0x00,0x01,0x0F,0x0E,0x00,0xFF,0xE4,0x8C,0xF9,0x01,0xFE,0xA1,0x42,0x00,0x27,0xD0,0x4B,0x00};
CsrUint8 eventBuffer7_2[CM_FULL_BUFFER_LEN7_2] = { 0x00,0x01,0x00,0x00,0x04,0x0A, 0xAA, 0x01,0x30,0x0E,0x00,0xFF,0xE4,0xBA,0xFA,0x01,0x5C,0x4B,0x61,0x00,0x58,0x48,0x1F,0x00,0x01,0x35,0x0E,0x00,0xFF,0xE6,0x75,0xFA,0x01,0x68,0x88,0x24,0x00,0x6B,0xE8,0xCB,0x00,0x01,0x0D,0x0E,0x00,0xFF,0xE3,0xA5,0xFA,0x01,0xBD,0x99,0xDD,0x00,0x1A,0xCB,0xB5,0x00,0x01,0x1F,0x0E,0x00,0xFF,0xE4,0xCD,0xFA,0x01,0x6A,0x51,0x9A,0x00,0x90,0x14,0xB1,0x00,0x01,0x47,0x0E,0x00,0xFF,0xE6,0x84,0xFA,0x01,0x2F,0x65,0x67,0x00,0x83,0x72,0x7F,0x00,0x01,0x0C,0x0E,0x00,0xFF,0xE2,0xB9,0xFA,0x01,0x6D,0x96,0x07,0x00,0x5B,0x85,0x41,0x00,0x01,0x2B,0x0E,0x00,0xFF,0xE5,0x89,0xFA,0x01,0xC2,0xE4,0x5F,0x00,0x0A,0x3F,0x77,0x00,0x01,0x1F,0x0E,0x00,0xFF,0xE4,0xD5,0xFA,0x01,0xCE,0xD3,0xA7,0x00,0x3D,0x06,0xD7,0x00,0x01,0x37,0x0E,0x00,0xFF,0xE4,0x61,0xFB,0x01,0x00,0x88,0x1F,0x00,0x59,0x18,0xD5,
                                                   0x00,0x01,0x35,0x0E,0x00,0xFF,0xE5,0xBB,0xFA,0x01,0xB5,0x3D,0x78,0x00,0x7B,0x28,0x31,0x00};
CsrUint8 eventBuffer7_3[CM_FULL_BUFFER_LEN7_3] = { 0x00,0x37,0x01,0x00,0x00,0x27,0xFF,0xFF,0x01,0x01,0x00,0x04,0x0B, 0xD8, 0x00,0x11,0x05,0x00,0xE3,0x01,0x25,0xFF,0x00,0x31,0x05,0x00,0xE5,0x01,0x27,0xFF,0x00,0x0E,0x05,0x02,0xA7,0x01,0x22,0xFF,0x02,0x47,0x15,0x0B,0x2E,0x0F,0xFD,0x03,0x28,0x3F,0xFD,0x03,0x28,0x6F,0xFD,0x03,0x24,0xAF,0xFD,0x03,0x2A,0x7F,0xFD,0x23,0x02,0x08,0x15,0x11,0x21,0x50,0xF6,0x03,0x18,0xD0,0xF6,0x03,0x0A,0xC0,0xF6,0x03,0x0D,0xD0,0xF6,0x03,0x00,0xD0,0xF6,0x23,0x02,0x30,0x15,0x11,0xB6,0xF0,0x00,0x03,0xB6,0xA0,0x00,0x03,0xB2,0x90,0x00,0x03,0xB7,0x20,0x00,0x03,0xB5,0x10,0x00,0x23,0x02,0x23,0x15,0x11,0x8D,0x10,0xFC,0x03,0x8D,0x50,0xFC,0x03,0x8E,0xD0,0xFB,0x03,0x88,0xB0,0xFB,0x03,0x86,0xC0,0xFB,0x23,0x02,0x0E,0x15,0x13,0xBD,0x2F,0x09,0x03,0xC4,0xCF,0x08,0x03,0xC9,0x9F,0x08,0x03,0xCE,0xAF,0x08,0x03,0xFE,0x0F,0x00,0x13,0x02,
                                                   0x03,0x15,0x02,0x5E,0x80,0xF7,0x03,0x57,0x00,0xF8,0x03,0x57,0x00,0xF8,0x03,0x4B,0xD0,0xF7,0x03,0x49,0x90,0xF7,0x23,0x02,0x45,0x15,0x03,0x48,0x90,0x0C,0x03,0x45,0x60,0x0C,0x03,0x4B,0x90,0x0C,0x03,0x52,0x40,0x0C,0x03,0x52,0xA0,0x0C,0x23,0x02,0x0D,0x15,0x12,0x79,0x2F,0x05,0x03,0x7C,0xFF,0x04,0x03,0x82,0x0F,0x05,0x03,0x82,0xEF,0x04,0x03,0x7E,0x8F,0x04,0x23};
CsrUint8 eventBuffer7_4[CM_FULL_BUFFER_LEN7_4] = { 0x00,0x01,0x00,0x00,0x04,0x04, 0x60, 0x02,0x20,0x15,0x11,0x64,0x8F,0xFE,0x03,0x63,0xAF,0xFE,0x03,0x67,0xCF,0xFE,0x03,0x6B,0x5F,0xFF,0x03,0xFF,0x1F,0x00,0x13,0x02,0x36,0x15,0x0A,0x54,0xC0,0x0A,0x03,0x5A,0x50,0x0A,0x03,0x58,0x40,0x0A,0x03,0x5F,0x50,0x0A,0x03,0x61,0x10,0x0A,0x23,0x02,0x3B,0x15,0x13,0x4F,0xB0,0x0B,0x03,0x56,0x10,0x0B,0x03,0x5E,0x50,0x0B,0x03,0x55,0x20,0x0B,0x03,0x00,0x00,0x00,0x13,0x02,0x07,0x15,0x11,0x5F,0x9F,0xFF,0x03,0x69,0x2F,0x00,0x03,0x6B,0x3F,0x00,0x03,0x6C,0xBF,0x00,0x03,0x6E,0x3F,0x01,0x23};
CsrUint8 eventBuffer7_5[CM_FULL_BUFFER_LEN7_5] = { 0x00,0x37,0x01,0x00,0x00,0x1E,0xFF,0xFF,0x01,0x00,0x00,0x04,0x06, 0xC6, 0x00,0x32,0x05,0x00,0xE6,0x01,0x1E,0xFF,0x03,0x07,0x23,0x00,0xFF,0xE4,0xAA,0xF9,0x01,0x7D,0x0D,0x40,0x00,0x4C,0x4B,0x0B,0x00,0x17,0x8E,0xE0,0xF9,0x03,0x90,0x40,0xFA,0x03,0x8B,0xA0,0xFA,0x03,0x8A,0x30,0xFB,0x03,0x00,0x00,0x00,0x13,0x03,0x3F,0x23,0x00,0xFF,0xE7,0xD9,0xF9,0x01,0xEC,0x03,0xBF,0x00,0x8A,0x15,0xE8,0x00,0x17,0x29,0xC0,0x0D,0x03,0x2A,0xB0,0x0D,0x03,0x2C,0xC0,0x0D,0x03,0x31,0xB0,0x0D,0x03,0xFE,0xEF,0xFF,0x13,0x03,0x48,0x23,0x00,0xFF,0xE5,0xB9,0xF9,0x01,0xB3,0x2A,0x0C,0x00,0xF2,0x3A,0xE2,0x00,0x12,0x59,0x3F,0xF6,0x03,0x58,0x4F,0xF6,0x03,0x59,0x3F,0xF6,0x03,0x56,0x6F,0xF6,0x03,0x58,0x1F,0xF6,0x23,0x03,0x1C,0x23,0x00,0xFF,0xE6,0xA5,0xF9,0x01,0x49,0xF4,0xB8,0x00,0x1E,0x56,0xE7,0x00,0x03,0x2F,0xA0,0xF5,0x03,0x31,
                                                   0xA0,0xF5,0x03,0x31,0xE0,0xF5,0x03,0x31,0x00,0xF6,0x03,0x00,0x00,0x00,0x13,0x03,0x21,0x23,0x00,0xFF,0xE4,0x28,0xFA,0x01,0x03,0x5C,0xEA,0x00,0x45,0x2F,0xBD,0x00,0x07,0x66,0xB0,0x08,0x03,0x62,0xF0,0x08,0x03,0x60,0xF0,0x08,0x03,0x58,0x40,0x09,0x03,0x01,0x00,0x00,0x13};
CsrUint8 eventBuffer7_6[CM_FULL_BUFFER_LEN7_6] = { 0x00,0x37,0x01,0x00,0x00,0x1E,0xFF,0xFF,0x00,0x00,0x00,0x04,0x04, 0x57, 0x00,0x0B,0x05,0x02,0xA7,0x01,0x29,0xFF,0x01,0x1F,0x0E,0x00,0xFF,0xE4,0xCD,0xFA,0x01,0x6A,0x51,0x9A,0x00,0x90,0x14,0xB1,0x00,0x02,0x23,0x15,0x11,0x8D,0x10,0xFC,0x03,0x8D,0x50,0xFC,0x03,0x8E,0xD0,0xFB,0x03,0x88,0xB0,0xFB,0x03,0x86,0xC0,0xFB,0x23,0x03,0x10,0x23,0x00,0xFF,0xE7,0x26,0xFA,0x01,0x05,0x7B,0xBF,0x00,0x2D,0xFF,0x99,0x00,0x0F,0x8F,0x70,0xFA,0x03,0x8E,0x50,0xFA,0x03,0x8E,0xB0,0xFA,0x03,0x89,0x00,0xFB,0x03,0x00,0x00,0x00,0x13};

CsrUint8 *eventBuffer7_x[] = 
{
    eventBuffer7_1,
    eventBuffer7_2,
    eventBuffer7_3,
    eventBuffer7_4,
    eventBuffer7_5,
    eventBuffer7_6
};


static CsrUint8 parseUint8(CsrUint8 *buffer, CsrUint16 *offset)
{
    CsrUint8 value = buffer[*offset];
    (*offset) += 1;
    return value;
}

static CsrUint16 parseUint16(CsrUint8 *buffer, CsrUint16 *offset)
{
    CsrUint16 value = (buffer[*offset] | (buffer[*offset + 1] << 8));
    (*offset) += 2;
    return value;
}

static void cmSubeventTimerHandler(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer[subEventCurrentCounter % CM_TOTAL_EVENT_BUFFERS];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;

    CSR_UNUSED(mi);

    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));

        ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
        ind->addrt = simulationBdAddress;
        ind->configId = parseUint8(currentBuffer, &offset);
        ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
        ind->procedureCounter = parseUint16(currentBuffer, &offset);
        ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
        ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
        ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
        ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
        ind->abortReason = parseUint8(currentBuffer, &offset);
        ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
        ind->numStepsReported = parseUint8(currentBuffer, &offset);
        ind->stepsDataLen = parseUint8(currentBuffer, &offset);

        stepsSize = subEventCurrentCounter != 6 ? CM_FULL_BUFFER_LEN: CM_PARTIAL_BUFFER_LEN;
        stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
        ind->steps = CsrPmemZalloc(stepsSize);

        SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);

        CsrBtCmPutMessage(cmData->csHandle, ind);

        subEventCurrentCounter++;

        if (subEventCurrentCounter < CM_TOTAL_EVENT_BUFFERS)
        {
            /* rescheduling the timer.*/
            subEventTimerId = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler, 0, cmData);
        }
        else
        {
            /* kill it. */
            subEventCurrentCounter = 0;
            CsrSchedTimerCancel(subEventTimerId, NULL, NULL);
        }
    }
}

static void cmSubeventTimerHandler2(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer2_x[subEventCurrentCounter1 % CM_TOTAL_EVENT_BUFFERS2];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;

    CSR_UNUSED(mi);
    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind;
        CmLeCsSubeventResultContinueInd *ind1;

        if(subEventCurrentCounter1 == 0)
        {
            stepsSize = CM_FULL_BUFFER_LEN2_1;
        }
        else if (subEventCurrentCounter1 == 1)
        {
            stepsSize = CM_PARTIAL_BUFFER_LEN2_2;
        }
        else
        {
            stepsSize = CM_PARTIAL_BUFFER_LEN2_3;
        }


        if (subEventCurrentCounter1 == 0)
        {
           ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));
           ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
           ind->addrt = simulationBdAddress;
           ind->configId = parseUint8(currentBuffer, &offset);
           ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
           ind->procedureCounter = parseUint16(currentBuffer, &offset);
           ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
           ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
           ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind->abortReason = parseUint8(currentBuffer, &offset);
           ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind->numStepsReported = parseUint8(currentBuffer, &offset);
           ind->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind->steps = CsrPmemZalloc(stepsSize);
           
           SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);
           
           CsrBtCmPutMessage(cmData->csHandle, ind);

        }
        else
        {
           ind1 = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*ind1));
           ind1->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
           ind1->addrt = simulationBdAddress;
           ind1->configId = parseUint8(currentBuffer, &offset);
           ind1->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->abortReason = parseUint8(currentBuffer, &offset);
           ind1->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind1->numStepsReported = parseUint8(currentBuffer, &offset);
           ind1->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind1->steps = CsrPmemZalloc(stepsSize);           

           SynMemCpyS(ind1->steps, stepsSize, &currentBuffer[offset], stepsSize);
           CsrBtCmPutMessage(cmData->csHandle, ind1);
        }

        subEventCurrentCounter1++;

        if (subEventCurrentCounter1 < 3)
        {
            /* Rescheduling the timer. */
            subEventTimerId1 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler2, 0, cmData);
        }
        else
        {
            /* Kill it. */
            subEventCurrentCounter1 = 0;
            CsrSchedTimerCancel(subEventTimerId, NULL, NULL);
        }
    }
}

#ifdef SUBEVENT32
static void cmSubeventTimerHandler3(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer3_x[subEventCurrentCounter3 % CM_TOTAL_EVENT_BUFFERS3];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;

    CSR_UNUSED(mi);

    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));

        ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
        ind->addrt = simulationBdAddress;
        ind->configId = parseUint8(currentBuffer, &offset);
        ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
        ind->procedureCounter = parseUint16(currentBuffer, &offset);
        ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
        ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
        ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
        ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
        ind->abortReason = parseUint8(currentBuffer, &offset);
        ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
        ind->numStepsReported = parseUint8(currentBuffer, &offset);
        ind->stepsDataLen = parseUint8(currentBuffer, &offset);

        stepsSize = CM_FULL_BUFFER_LEN3_1;
        stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
        ind->steps = CsrPmemZalloc(stepsSize);

        SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);

        CsrBtCmPutMessage(cmData->csHandle, ind);

        subEventCurrentCounter3++;

        if (subEventCurrentCounter3 < 1)
        {
            /* rescheduling the timer.*/
            subEventTimerId3 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler3, 0, cmData);
        }
        else
        {
            /* kill it. */
            subEventCurrentCounter3 = 0;
            CsrSchedTimerCancel(subEventTimerId3, NULL, NULL);
        }
    }
}
#endif /* SUBEVENT32 */

#ifdef MAX_STEPS_TC
static void cmSubeventTimerHandler4(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer4_x[subEventCurrentCounter4 % CM_TOTAL_EVENT_BUFFERS4];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;
    uint8 subeventResult = 1;

    CSR_UNUSED(mi);
    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind;
        CmLeCsSubeventResultContinueInd *ind1;

        if(subEventCurrentCounter4 % 2 == 0)
        {
            stepsSize = CM_FULL_BUFFER_LEN4_1;
            subeventResult = 1;
        }
        else
        {
            stepsSize = CM_FULL_BUFFER_LEN4_2;
            subeventResult = 0;
        }

        if (subEventCurrentCounter4 == 38)
        {
            stepsSize = CM_FULL_BUFFER_LEN4_3;
            subeventResult = 1;
        }

        if (subeventResult == 1)
        {
           ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));
           ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
           ind->addrt = simulationBdAddress;
           ind->configId = parseUint8(currentBuffer, &offset);
           ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
           ind->procedureCounter = parseUint16(currentBuffer, &offset);
           ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
           ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
           ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind->abortReason = parseUint8(currentBuffer, &offset);
           ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind->numStepsReported = parseUint8(currentBuffer, &offset);
           ind->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind->steps = CsrPmemZalloc(stepsSize);
           
           SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);
           
           CsrBtCmPutMessage(cmData->csHandle, ind);

        }
        else
        {
           ind1 = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*ind1));
           ind1->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
           ind1->addrt = simulationBdAddress;
           ind1->configId = parseUint8(currentBuffer, &offset);
           ind1->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->abortReason = parseUint8(currentBuffer, &offset);
           ind1->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind1->numStepsReported = parseUint8(currentBuffer, &offset);
           ind1->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind1->steps = CsrPmemZalloc(stepsSize);           

           SynMemCpyS(ind1->steps, stepsSize, &currentBuffer[offset], stepsSize);
           CsrBtCmPutMessage(cmData->csHandle, ind1);
        }

        subEventCurrentCounter4++;

        if (subEventCurrentCounter4 < 39)
        {
            /* Rescheduling the timer. */
            subEventTimerId4 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler4, 0, cmData);
        }
        else
        {
            /* Kill it. */
            subEventCurrentCounter4 = 0;
            CsrSchedTimerCancel(subEventTimerId4, NULL, NULL);
        }
    }

}

static void cmSubeventTimerHandler5(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer4_x[subEventCurrentCounter4 % CM_TOTAL_EVENT_BUFFERS4];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;
    uint8 subeventResult = 1;

    CSR_UNUSED(mi);
    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind;
        CmLeCsSubeventResultContinueInd *ind1;

        if(subEventCurrentCounter4 % 2 == 0)
        {
            stepsSize = CM_FULL_BUFFER_LEN4_1;
            subeventResult = 1;
        }
        else
        {
            stepsSize = CM_FULL_BUFFER_LEN4_2;
            subeventResult = 0;
        }

        if (subeventResult == 1)
        {
           ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));
           ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
           ind->addrt = simulationBdAddress;
           ind->configId = parseUint8(currentBuffer, &offset);
           ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
           ind->procedureCounter = parseUint16(currentBuffer, &offset);
           ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
           ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
           ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind->abortReason = parseUint8(currentBuffer, &offset);
           ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind->numStepsReported = parseUint8(currentBuffer, &offset);
           ind->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind->steps = CsrPmemZalloc(stepsSize);
           
           SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);
           
           CsrBtCmPutMessage(cmData->csHandle, ind);

        }
        else
        {
           ind1 = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*ind1));
           ind1->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
           ind1->addrt = simulationBdAddress;
           ind1->configId = parseUint8(currentBuffer, &offset);
           ind1->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->abortReason = parseUint8(currentBuffer, &offset);
           ind1->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind1->numStepsReported = parseUint8(currentBuffer, &offset);
           ind1->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind1->steps = CsrPmemZalloc(stepsSize);           

           SynMemCpyS(ind1->steps, stepsSize, &currentBuffer[offset], stepsSize);
           CsrBtCmPutMessage(cmData->csHandle, ind1);
        }

        subEventCurrentCounter4++;

        /* Ranging data overwritten test */
        if (subEventCurrentCounter4 < 2)
        {
            /* Rescheduling the timer. */
            subEventTimerId4 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler5, 0, cmData);
        }
        else
        {
            /* Kill it. */
            subEventCurrentCounter4 = 0;
            CsrSchedTimerCancel(subEventTimerId4, NULL, NULL);
        }
    }

}

#endif /* MAX_STEPS_TC */

static void cmSubeventTimerHandler6(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer6_x[subEventCurrentCounter6 % CM_TOTAL_EVENT_BUFFERS6];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;

    CSR_UNUSED(mi);
    if (currentBuffer)
    {
        CmLeCsSubeventResultInd *ind;
        CmLeCsSubeventResultContinueInd *ind1;

        if(subEventCurrentCounter6 == 0)
        {
            stepsSize = CM_FULL_BUFFER_LEN6_1;
        }
        else if (subEventCurrentCounter6 == 1)
        {
            stepsSize = CM_FULL_BUFFER_LEN6_2;
        }
        else if (subEventCurrentCounter6 == 2)
        {
            stepsSize = CM_FULL_BUFFER_LEN6_3;
        }
        else if (subEventCurrentCounter6 == 3)
        {
            stepsSize = CM_FULL_BUFFER_LEN6_4;
        }
        else
        {
            stepsSize = CM_FULL_BUFFER_LEN6_5;
        }


        if (subEventCurrentCounter6 == 0 || subEventCurrentCounter6 == 4)
        {
           ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));
           ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
           ind->addrt = simulationBdAddress;
           ind->configId = parseUint8(currentBuffer, &offset);
           ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
           ind->procedureCounter = parseUint16(currentBuffer, &offset);
           ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
           ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
           ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind->abortReason = parseUint8(currentBuffer, &offset);
           ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind->numStepsReported = parseUint8(currentBuffer, &offset);
           ind->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind->steps = CsrPmemZalloc(stepsSize);
           
           SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);
           
           CsrBtCmPutMessage(cmData->csHandle, ind);

        }
        else
        {
           ind1 = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*ind1));
           ind1->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
           ind1->addrt = simulationBdAddress;
           ind1->configId = parseUint8(currentBuffer, &offset);
           ind1->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->abortReason = parseUint8(currentBuffer, &offset);
           ind1->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind1->numStepsReported = parseUint8(currentBuffer, &offset);
           ind1->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind1->steps = CsrPmemZalloc(stepsSize);           

           SynMemCpyS(ind1->steps, stepsSize, &currentBuffer[offset], stepsSize);
           CsrBtCmPutMessage(cmData->csHandle, ind1);
        }

        subEventCurrentCounter6++;

        if (subEventCurrentCounter6 < 5)
        {
            /* Rescheduling the timer. */
            subEventTimerId6 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler6, 0, cmData);
        }
        else
        {
            /* Kill it. */
            subEventCurrentCounter6 = 0;
            CsrSchedTimerCancel(subEventTimerId6, NULL, NULL);
        }
    }
}

static void cmSubeventTimerHandler7(CsrUint16 mi, void *mv)
{
    CsrUint8 *currentBuffer = eventBuffer7_x[subEventCurrentCounter7 % CM_TOTAL_EVENT_BUFFERS7];
    CsrUint16 offset = 0, stepsSize = 0;
    cmInstanceData_t *cmData = (cmInstanceData_t *)mv;

    CSR_UNUSED(mi);
    if (currentBuffer)
    {
        CmLeCsSubeventResultContinueInd *ind1;
        CmLeCsSubeventResultInd *ind;

        if(subEventCurrentCounter7 == 0)
        {
            stepsSize = CM_FULL_BUFFER_LEN7_1;
        }
        else if (subEventCurrentCounter7 == 1)
        {
            stepsSize = CM_FULL_BUFFER_LEN7_2;
        }
        else if (subEventCurrentCounter7 == 2)
        {
            stepsSize = CM_FULL_BUFFER_LEN7_3;
        }
        else if (subEventCurrentCounter7 == 3)
        {
            stepsSize = CM_FULL_BUFFER_LEN7_4;
        }
        else if (subEventCurrentCounter7 == 4)
        {
            stepsSize = CM_FULL_BUFFER_LEN7_5;
        }
        else
        {
            stepsSize = CM_FULL_BUFFER_LEN7_6;
        }

        if (subEventCurrentCounter7 == 1 || subEventCurrentCounter7 == 3)
        {
           ind1 = (CmLeCsSubeventResultContinueInd *) CsrPmemZalloc(sizeof(*ind1));
           ind1->type = CM_LE_CS_SUBEVENT_RESULT_CONTINUE_IND;
           ind1->addrt = simulationBdAddress;
           ind1->configId = parseUint8(currentBuffer, &offset);
           ind1->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind1->abortReason = parseUint8(currentBuffer, &offset);
           ind1->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind1->numStepsReported = parseUint8(currentBuffer, &offset);
           ind1->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind1->steps = CsrPmemZalloc(stepsSize);

           SynMemCpyS(ind1->steps, stepsSize, &currentBuffer[offset], stepsSize);
           CsrBtCmPutMessage(cmData->csHandle, ind1);
        }
        else
        {
           ind = (CmLeCsSubeventResultInd *) CsrPmemZalloc(sizeof(*ind));
           ind->type = CM_LE_CS_SUBEVENT_RESULT_IND;
           ind->addrt = simulationBdAddress;
           ind->configId = parseUint8(currentBuffer, &offset);
           ind->startAclConnEventCounter = parseUint16(currentBuffer, &offset);
           ind->procedureCounter = parseUint16(currentBuffer, &offset);
           ind->frequencyCompensation = parseUint16(currentBuffer, &offset);
           ind->referencePowerLevel = parseUint8(currentBuffer, &offset);
           ind->procedureDoneStatus = parseUint8(currentBuffer, &offset);
           ind->subeventDoneStatus = parseUint8(currentBuffer, &offset);
           ind->abortReason = parseUint8(currentBuffer, &offset);
           ind->numAntennaPaths = parseUint8(currentBuffer, &offset);
           ind->numStepsReported = parseUint8(currentBuffer, &offset);
           ind->stepsDataLen = parseUint8(currentBuffer, &offset);
           stepsSize = (stepsSize - offset) * sizeof(CsrUint8);
           ind->steps = CsrPmemZalloc(stepsSize);

           SynMemCpyS(ind->steps, stepsSize, &currentBuffer[offset], stepsSize);

           CsrBtCmPutMessage(cmData->csHandle, ind);
        }


        subEventCurrentCounter7++;

        if (subEventCurrentCounter7 < 6)
        {
            /* Rescheduling the timer. */
            subEventTimerId7 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler7, 0, cmData);
        }
        else
        {
            /* Kill it. */
            subEventCurrentCounter7 = 0;
            CsrSchedTimerCancel(subEventTimerId7, NULL, NULL);
        }
    }
}


void CmCsLeGenerateTestVectorSubeventReqHandler(cmInstanceData_t *cmData)
{
    CmLeCsGenerateTestVectorSubeventReq *req = (CmLeCsGenerateTestVectorSubeventReq *) cmData->recvMsgP;

    simulationBdAddress = req->addrt;

    if (req->enableEvent == 1)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId1, NULL, NULL);
        subEventTimerId = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler, 0, cmData);
    }
    else if (req->enableEvent == 2)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId, NULL, NULL);
        subEventTimerId1 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler2, 0, cmData);
    }
#ifdef SUBEVENT32
    else if (req->enableEvent == 3)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId3, NULL, NULL);
        subEventTimerId3 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler3, 0, cmData);
    }
#endif /* SUBEVENT32 */
#ifdef MAX_STEPS_TC
    else if(req->enableEvent == 4)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId4, NULL, NULL);
        subEventTimerId4 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler4, 0, cmData);
    }
    else if (req->enableEvent == 5)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId4, NULL, NULL);
        subEventTimerId4 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS_3, cmSubeventTimerHandler5, 0, cmData);
    }
#endif /* MAX_STEPS_TC */
    else if(req->enableEvent == 6)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId6, NULL, NULL);
        subEventTimerId6 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler6, 0, cmData);
    }
    else if(req->enableEvent == 7)
    {
        /* Killing any other timer which could be running. */
        CsrSchedTimerCancel(subEventTimerId7, NULL, NULL);
        subEventTimerId7 = CsrSchedTimerSet((CsrTime)CM_SUBEVENT_INTERVAL_IN_SECS, cmSubeventTimerHandler7, 0, cmData);
    }
    else
    {
        /* Stop both the timers. */
        CsrSchedTimerCancel(subEventTimerId, NULL, NULL);
        CsrSchedTimerCancel(subEventTimerId1, NULL, NULL);
#ifdef SUBEVENT32
        CsrSchedTimerCancel(subEventTimerId3, NULL, NULL);
#endif /* SUBEVENT32 */
#ifdef MAX_STEPS_TC
        CsrSchedTimerCancel(subEventTimerId4, NULL, NULL);
#endif /* MAX_STEPS_TC */
        CsrSchedTimerCancel(subEventTimerId6, NULL, NULL);
        CsrSchedTimerCancel(subEventTimerId7, NULL, NULL);
    }
}

#ifdef CSR_STREAMS_ENABLE
void CmCsLeSubeventResultRspHandler(cmInstanceData_t *cmData)
{
    CSR_LOG_TEXT_INFO((CsrBtCmLto, 0, "CmCsLeSubeventResultRspHandler: cmData->csEventSource: 0x%x ",  cmData->csEventSource));

    /* Subevent data is consumed by application, process more data from the stream (if any).*/
    if (SourceIsValid(cmData->csEventSource))
    {
        CsrBtCmStreamProcessData(cmData, cmData->csEventSource);
    }
}
#endif /* CSR_STREAMS_ENABLE */


#endif /* INSTALL_CHANNEL_SOUNDING_SUPPORT */
